Multiple Inputs | SoloLearn: Learn to code for FREE!

+1

Multiple Inputs

Java: I am making a simple program that has the user try and guess a secret number. What program would I write if I wanted to allow the user to keep guessing if they get it wrong (until they get it right). Thanks!

2/22/2018 2:52:53 AM

Maddie

4 Answers

New Answer

+2

You would use a while loop to do this. Format (I don't know what language it is in): While guess != secretNumber input guess

+1

using scanner to get input you would do, Scanner input = new Scanner (System.in); String guess; while(guess!=secretNumber){ guess = input.next (); }

0

im what programming language is it?

0

It is in java, sorry!