207,019 views
31 votes
31 votes
4- In a for loop with a multistatement loop body, semicolons should appear following a. the for statement itself. b. the closing brace in a multistatement loop body. c. each statement within the loop body. d. the test expression. ​

User Catandmouse
by
2.9k points

1 Answer

19 votes
19 votes

Answer:

c. Each statement within the loop body.

Step-by-step explanation:

In a for loop with a multistatement loop body, semicolons should appear following each statement within the loop body. This is because the semicolon is used to separate multiple statements on a single line, and in a for loop with a multistatement loop body, there will be multiple statements within the loop body.

Here is an example of a for loop with a multistatement loop body:

for (int i = 0; i < 10; i++) {

statement1;

statement2;

}

In this example, semicolons should appear following statement1 and statement2.

User Komodoedit
by
3.4k points