it's the K and R c programming exercise, I don't know why my program doesnt work, could anyone help, please and thank you.
When I run the program and type a line of words or two and hit 'Enter', it doesnt show anything, it just jumps to the next line and thats it
#include <stdio.h>
int main()
{
int c, line, tab, blank;
line = 0;
tab = 0;
blank = 0;
while ( (c = getchar()) != EOF)
{
if (c == '\n')
++line;
if (c == '\t')
++tab;
if (c == ' ')
++blank;
}
printf("Lines: %d\n Tabs: %d\n Blanks: %d\n", line, tab, blank);
return 0;
}