Skip to content
Advertisement

How to limit incorrect answers from users input?

I’m here with my code, here you can see it:

JavaScript

Let me explain: I defined false for, if user inputs the answer 3 times and all of them for that question are false, show user the answer and continue asking

Actually this code asks 10 different math questions, this is a part of my code, I’m checking if answer is not true print(‘EEE’) and re ask it again, but if user tries 3 time and all incorrect, then I show the answer, pass that question and keep asking other questions.

If you have any ideas for re asking question, when users input was non-numerical, I’ll be thankful.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement