C - char data type ================== Public domain ******************************************************************************** #include #include int main() { char ch; ch='a'; fprintf(stdout, "This is a single character: %c\n", ch); fprintf(stdout, "ASCII code of '%c' is : %d\n", ch, ch); fprintf(stdout, "Number of bits in a 'char' type : %d\n", CHAR_BIT); fprintf(stdout, "Minimum and maximum values a 'signed char' can hold : %d %d \n", SCHAR_MIN, SCHAR_MAX); fprintf(stdout, "Minimum and maximum values an 'unsigned char' can hold : 0 %d \n", UCHAR_MAX); return 0; } ******************************************************************************** ### --Output-- This is a single character: a ASCII code of 'a' is : 97 Number of bits in a 'char' type : 8 Minimum and maximum values a 'signed char' can hold : -128 127 Minimum and maximum values an 'unsigned char' can hold : 0 255 ******************************************************************************** _BY: Pejman Moghadam_ _TAG: c, data-type_ _DATE: 2011-02-28 15:31:00_