C examples for Data Type:Introduction
Characters are also easy to display using the %c conversion specifier.
#include <stdio.h> int main()//from w ww .j av a 2 s.c o m { printf("%c", 'M'); return 0; }
You can output the contents of a character variable data type using the %c conversion specifier and a printf() function.
#include <stdio.h> int main()/* ww w . ja v a2s . c o m*/ { char firstInitial; firstInitial = 'S'; printf("The value of firstInitial is %c", firstInitial); return 0; }