Multiple Inputs | SoloLearn: Learn to code for FREE!


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


4 Answers

New Answer


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


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


im what programming language is it?


It is in java, sorry!