C examples for Data Type:char
Count characters in input with while loop
#include <stdio.h> int main()// w ww .jav a 2s . co m { long nc; nc = 0; while (getchar() != EOF) ++nc; printf("%ld\n", nc); return 0; }