50.0k views
2 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 Starchand
by
8.4k points

1 Answer

2 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 Ludovico
by
7.9k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.