int x;
while(cin>>x)
{
cout<<"Yes"<<endl;
}
int y;
while(cin>>y)
{
cout<<"Yes again"<<endl;
}
What I expected to happen is,that as long as I entered a number for x(in line 2)that block should be run and "Yes" must be printed.
To get out of the 1st while loop I enter some char like 'h' and the same thing applies with the second while loop.
But what happens is when I enter 'h' both the loops break and the program ends.
Why does this happen?