How do I create a program that repeatedly asks the question until the user gives the correct answer? Below is a simple code to explain what exactly I'm asking…
prompt = 'What age is Seán? '; age = (input(prompt)); ageans = 21; if age == ageans disp('Correct!'); else disp('Wrong'); end
So if someone were to answer 37, rather than 21, how would I change the code so that it would loop back to the original question to ask the user again?
Best Answer