672 views
1 1 vote

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.

Position:
Show:

Related questions

0 0 votes
2 2 answers
994
994 views
radha gogia asked Aug 9, 2015
994 views
#include<stdio.h int f(); int main(){ printf("hello"); int a=f(); printf("%d",a); return 0; } int f(){ main(); return 8; }Why is 8 not printed here? I am a bit confused t...
0 0 votes
1 1 answer
909
909 views
radha gogia asked Aug 9, 2015
909 views
#include<stdio.h int f(); int main() { f(); return 0; }
0 0 votes
4 4 answers
802
802 views
anonymous asked May 14, 2018
802 views
main(){int a = 1; int b = 1; int c = a || b ; printf("a = %d b=%d\n",a,b); return 0;}