#include /** * whitespace - count spaces, tabs, newlines */ int main () { int c; // A character int nl; // Count of newlines int spaces; // Count of spaces int tabs; // count of tabs nl = 0; spaces = 0; tabs = 0; while ((c = getchar ()) != EOF) { if (c == '\n') ++nl; if (c == ' ') ++spaces; if (c == '\t') ++tabs; } // while printf ("%d newlines\n", nl); printf ("%d spaces\n", spaces); printf ("%d tabs\n" , tabs); return 0; } // main