Solved

What Is Wrong with the Following While Loop? While (Sum

Question 6

Multiple Choice

What is wrong with the following while loop? while (sum <= 1000) {
Sum = sum - 30;
}


A) The parentheses should be braces.
B) There should be a semicolon after while (sum <= 1000) .
C) sum = sum - 30 should be sum = sum + 30 or else the loop may never end.
D) None of the above.

Correct Answer:

verifed

Verified

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

Related Questions