89.3k views
1 vote
Which commands (constructs) do NOT have a loop when expressed in syntax graphs? Select all that apply Group of answer choices if-then-else switch (expr) { case value: statements ;} for ( ; ; ) {} while (condition) do {statements;}

User Edward Tan
by
7.8k points

1 Answer

4 votes

Answer:

if-then-else

switch (expr) { case value: statements ;}

Step-by-step explanation:

Required

Which do not represent loop

Literally, looping means repeating an action or sequence of actions as long as a given condition is true.

For options (a) to (d), we have:

(a): if-then-else:

if statements are used to test conditions; depending on the truth or falsity of the condition, only one block of code can be executed at once.

In summary, if statements are not loops

(b): switch statements

This is an alternate to if statements and can be used in place of if statements.

Hence, switch statements are not loops

(c) and (d): for and while:

The above represent loops, because they both involve repetition of operations until the condition is no longer satisfied.

User Benxamin
by
8.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.