Hi, just started c programming on a Mac. I have this simple program and run it in a terminal but it doesn't terminate. Just keeps waiting for input. It shows EOF as -1 but if i type -1 it keeps waiting?
Code:#include <stdio.h>
main()
{
int c;
printf("%d\n", EOF);
while ((c = getchar()) != EOF)
putchar(c);
}