edited by
818 views
1 votes
1 votes
#include<stdio.h>
main()
{
    int c,nb,nt,nn;
    nb=0;
    nt=0;
    nn=0;
    while((c=getchar())!=EOF)
        if(c==' ')
        ++nb;
        else if(c=='\t')
        ++nt;
        else if(c=='\n')
        ++nn;
        printf("The number of blanks,tabs,and newlines are->%d\t%d\t%d",nb,nt,nn);
}

 the program does not show output for corresponding string input in Dev C++.Can anyone please answer this?
edited by

1 Answer

1 votes
1 votes

Hi please change the line

 if(c=='')

to 

if(c==' ') // a space between the quotes .

Then Just type some string in the console and after that give ctrl+z if it is for windows.

Please refer this link for more

https://stackoverflow.com/questions/1782080/what-is-eof-in-the-c-programming-language

Related questions

0 votes
0 votes
2 answers
4