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.


c. sum = sum – 30 should be sum = sum + 30 or else the loop may never end.

Computer Science & Information Technology

You might also like to view...

It is never a good idea to repeat your contact information at the end of a presentation

Indicate whether the statement is true or false

Computer Science & Information Technology

When English-like phrases are used to describe the steps in an algorithm, the description is called ____.

a. pseudocode b. a formula c. a flowchart d. a program

Computer Science & Information Technology

You are ready to publish a file that was originally excluded from publishing because you were still working on it.  To publish the file, ____ the file name, click Exclude from Publishing to remove the icon, and then publish the site again.

A. click B. right-click C. double-click D. drag

Computer Science & Information Technology

A file with permissions of crw-rw-r-- is a character device file.

a. true b. false

Computer Science & Information Technology