I've been having trouble with this program I've been working on and the problem happens when you enter a letter into an integer variable.
The program actually works pretty well and does what I want it to do which is ask a multiplication question and ask the user to try again if their wrong or ask a new question if their right.
The problem comes when the user enters a letter (or a decimal)instead of a number for their answer. I thought the 'else' statement would take care of any answer that wasn't correct, but it only works for incorrect integers. If you enter a non-integer as the answer the program will output:
WRONG!
Try Again...
What is numA X numB?
...in an infinite loop until I close the console window.
I only posted the part of my program that has the problem below. I also put where I am pretty sure the problem areas are in bold.
If anyone has an idea as to whats wrong please let me know how I can fix it.