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;}

Respuesta :

Answer:

if-then-else

switch (expr) { case value: statements ;}

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.