I've just started learning c.
I would like someone to explain to me what happens in the code below. What i don't understand is why it prints out all the characters i type. Shouldn't it only print out the first character, like the program below that.
Code:#include <stdio.h> main() { int c; c = getchar(); while (c !=EOF) { putchar(c); c = getchar(); } }Code:#include <stdio.h> main() { int c; c = getchar(); putchar(c); } }