Ask Question

In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner (System. in); System. out. print ("Enter a number "); int number = keyboard. nextInt (); while (number 500) { System. out. print ("Enter another number "); number = keyboard. nextInt (); }

+4
Answers (1)
  1. 6 December, 12:29
    0
    Any number less than or equal to 100 or greater than or equal to 500.

    Explanation:

    The loop is running if the number is greater than 100 and the number is less than 500 both conditions needs to be true to run the while loop so if the number entered less than or equal to 100 or greater than or equal to 500 then loop will stop and hence we don't need to enter the number.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner (System. in); ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers