hello everyone,
i executed this code but the loop never ends because i have no idea what EOF is hence the number of lines that i enter is not printed.
What do i press to signal EOF when i'm finish entering a suitable number of lines to see if they were counted by the program?(-1,0,1) do not work
not my code btwCode:#include <stdio.h>
/* count lines in input */
main()
{
int c, nl;
nl = 0;
while ((c = getchar()) != EOF)
if (c == '\n')
++nl;
printf("%d\n", nl);
}