This is the program that I wrote:
#include<iostream>
using namespace std;
int main()
{
int hex[16];
cout << "enter the 16 hexadecimal numbers\n";
for(int i = 0;i < 16;i++)
{
cin >> hex[i];
cout << "input worked\n";
}
}
Can you please explain to me why the "input worked" output is again being displayed after I inputted 'a'. Shouldn't the program stop if I did that?
What I mean is why does "input worked" line output after cin stopped taking input?I mean if there is a problem in taking input from cin why is cout still working?