Name: Anonymous 2013-09-30 11:14
ive been trying to learn c. in this program and a few others the app waits for EOF and i dunno how to send EOF on a terminal to make it work. i tried ^C and "." help plz?
#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);
}
#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);
}