Solved

For Which Input Values Will the Following Loop Not Correctly

Question 107

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents