Solved

What Is Wrong with the Following While Loop

Question 26

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

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

Related Questions