Solved

For Which Input Values Will the Following Loop Not Correctly

Question 65

Multiple Choice

For which input values will the following loop not correctly compute the maximum of the values? Scanner in = new Scanner (System.in) ;
Int max = 0;
While (in.hasNextInt() )
{
Int value = in.nextInt() ;
If (value > max)
{
Max = value;
}
}


A) 3 3 3 3
B) 0 1 2 9 107
C) 107 2 9 -3
D) -4 -2 -10 -7

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions