+ 1
How to fix infinite loop when user enters char into int data type
When we tell a user to enter a number, but instead they enter a character/string, the program will try and convert it into a number. When I try to loop it so the user can re-input the variable, infinite loop occurs. How do I fix this
1 Resposta
0
Implement a stop condition? Just allow 10 retries or stop if a valid number was entered