How to check user input for all possible values?

break; makes it jumps out of the loop. You are using break; out of condition, so the for loop stops after the 1st round anyway. All you need is to remove break; or add break; within if or else condition as you need.

Leave a Comment