#include <stdio.h> void main(){ int c; while(c = getchar() != EOF){ putchar(c); } } I enter characters into the console, they are displayed normally. But as soon as I press Enter, i.e. I enter '\n' , besides switching to a new line in the console, the previous line is also duplicated.

c = getchar(). - αλεχολυτ