C examples for Data Type:char
Using for loop
double count; for(count = 0; getchar() != EOF; ++count) ; /* null statement */ printf("%.0f\n", count);
Using while loop
long count = 0; while(getchar() != EOF) ++count; printf("%ld\n", count);