452 views
1 votes
1 votes

In the given program, when compiled in Dev c++ and executed, the main does not terminate. is there any explanation to this? ( page 16, Dennis Ritchie)

#include<stdio.h>

main()

{

    int c;

    c=getchar();

    while(c!=EOF)

        {

            putchar(c);

            c=getchar();

       }

}


 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
3
0 votes
0 votes
4 answers
4
anonymous asked May 14, 2018
342 views
main(){int a = 1; int b = 1; int c = a || b ; printf("a = %d b=%d\n",a,b); return 0;}