Printing extended ASCII characters - C Data Type

C examples for Data Type:char

Description

Printing extended ASCII characters

Demo Code

#include <stdio.h>



int main( void )
{
    unsigned char mychar;    /* Must be unsigned for extended ASCII */
    //w  w  w  .  j av a  2  s .co m
    /* Print extended ASCII characters 180 through 203 */

    for (mychar = 180; mychar < 204; mychar++)
    {
        printf("ASCII code %d is character %c\n", mychar, mychar);
    }

    return 0;
}

Result


Related Tutorials