int main()
{
int c;
c = getchar();
while (c!=EOF){
putchar(c);
c=getchar();
}
return 0;
}
in above code when I input value -1 why the loop doesn`t get terminated.
value of EOF = -1 I got from this code,
main()
{
printf("EOF is %d\n",EOF);
}
code get terminated when I use Ctrl+D,is there any other way to terminate the same code without using Ctrl+D.