Solved

What Is Wrong with the Following While Loop

Question 1

Multiple Choice

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


A) The parentheses should be braces.
B) Braces are required around sum = sum - 30;.
C) There should be a semicolon after while sum <= 1000 ) .
D) sum = sum - 30 should be sum = sum + 30 or else the loop may never end.

Correct Answer:

verifed

Verified

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