Program prints an extra row with value 10 after each input
I've got this simple program:
#include <stdio.h>
int main()
{
int c;
while ( ( c = getchar()) != EOF)
printf("%d %c\n", c, c);
return 1;
}
However for some reason when executing i get an extra value ten at the end:
a
97 a
10
b
98 b
10
abc
97 a
98 b
99 c
10
What is the value 10 and where does it come from? How do I stop it from
occurring?
No comments:
Post a Comment