I have a problem with this code. When I run the program, if I enter a number less than an 11-digit number, the program continues without any problems, but when I enter an 11-digit number, I am faced with the message "Enter a number" indefinitely. I get up and I have to close the program. What is the problem?
while (num != -1) {
cout << "ENTER A NUMBER" << endl;
cin >> num;
if (num%2==0) {
counter++;
}
}
cout << " number of even numbers are " << counter;
_getch();
return 0;