C Programming

LOOP (ITERATION) MULTIPLE CHOICE QUESTIONS

1

What is a "loop" in programming?

A.

A way to store multiple values in one variable.

B.

A structure that repeats a block of code while a condition is met.

C.

A command that skips the next line of code.

D.

A way to exit the program immediately.

2

Which type of loop is best when you know EXACTLY how many times you want to repeat something (like 10 times)?

A.

while loop

B.

do-while loop

C.

switch loop

D.

for loop

3

What is one single execution of a loop called?

A.

An Instance

B.

An Iteration

C.

A Cycle

D.

A Turn

4

Which loop structure is guaranteed to run at least ONCE, even if the condition is false from the start?

A.

for loop

B.

while loop

C.

if-else statement

D.

do-while loop

5

What happens if a loop's condition never becomes false?

A.

The computer will crash.

B.

The program will skip to the end.

C.

It creates an "Infinite Loop."

D.

The computer will automatically fix the error

6

When is an infinite loop used?

A.

To run a process that never stops(e.g. a server).

B.

To crash a program

C.

To cause a computer to run out of memory

D.

To repeat a task until a condition is met.

7

Which keyword is used to stop a loop immediately and move to the code following it?

A.

continue

B.

stop

C.

exit

D.

break

8

Which keyword is used to skip the rest of the current iteration and jump straight to the next round of the loop?

A.

jump

B.

continue

C.

break

D.

skip