Solved

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

Question 9

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

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