Say I write an application that prompts the user to enter an integer. If the user enters a double or string or anything, anything not an integer an error will appear. I'm having trouble writing code to combat this problem so I can errorproof my application.

I'm thinking I'll need to use a while loop to continually ask the user for an integer if they keep inputting something that's not an integer.

1 answer

that'd be a good way