In the below program:
#include <iostream>
using namespace std;
int main()
{
char ch;
while (cin >> ch){
cout << ch;
}
return 0;
}
input : abcEnter
output : abc
Whatever I type on the keyboard gets printed only when I press Enter i.e. new line.
Why is not each character being printed simultaneously? Which statement here takes the newline as an input and prints all the characters printed till now?