Multiple Choice
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 < 100 && number > 500)
{
System.out.print("Enter another number: ") ;
Number = keyboard.nextInt() ;
}
A) Numbers less than 100 or greater than 500
B) Numbers in the range 100 - 499
C) Numbers in the range 100 - 500
D) Impossible - the boolean condition can never be true
Correct Answer:

Verified
Correct Answer:
Verified
Q15: In all but very rare cases, loops
Q16: The while loop is always the best
Q17: The _ loop is ideal in situations
Q18: How many times will the following do-while
Q19: What will be the values of x
Q21: Which of the following statements opens a
Q22: The _ loop is ideal in situations
Q23: In a for loop, the control variable
Q24: The do-while loop must be terminated with
Q25: The do-while loop is ideal in situations