I've just begun to learn C and I've got a problem with some basic code. according to the book i'm reading (C Programming Language) this code should accept user input and then output it. Instead im just getting the first letter of the input before the program closes
#include <stdio.h>
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}