I'm trying to find that entered value from the user is String or Int,but program stuck in a loop when a user entered any string.Can I delete int taxableIncome
value one-time execution if yes then how ?
I'm beginner level programmer...
tell me anyway within that I can check Value from user is int or string....
here is code
int taxableIncome;
for (;;) {
cout << "Please enter in your taxable income: ";
if (cin >> taxableIncome) {
cout << "Your income: " << taxableIncome;
break;
} else {
cout << "Please enter a valid integer" << endl;
}
}