C examples for Data Type:char
This statement will output the value in ch as a character and as a numeric value.
#include <stdio.h> int main(void) { char ch = 0;//from www . j av a 2 s . c om scanf("%c", &ch); // Read one character printf("The character is %c\n", ch); printf("The character is %c and the code value is %d\n", ch, ch); return 0; }