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:
Verified
Q4: Which of the following encompasses the other
Q5: Specifying the order in which statements are
Q6: Which operation does not take place in
Q7: Pseudocode normally does not include:
A) Declarations.
B) Input/output.
C)
Q8: The conditional operator (?:):
A) Is the only
Q10: A block:
A) Must contain exactly three statements.
B)
Q11: Using a while loop's counter-control variable in
Q12: An uninitialized local variable contains:
A) The value
Q13: If grade has the value of 60,
Q14: The data type bool:
A) Can take on
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents