Yes, better to stay portable:Originally Posted by djtomr941
Code:#include <stdio.h> #include <ctype.h> int main (void) { int let = 0; int dig = 0; int other = 0; int c; while ((c = getchar ()) != '\n' && c != EOF) { if (isalpha (c)) { ++let; } else if (isdigit (c)) { ++dig; } else { ++other; } } printf ("%d letters, %d digits, %d others\n", let, dig, other); return 0; }