Match the columns.
(a) |
Nested loop |
(i) | Never editing loop |
(b) | Infinite loop | (ii) | indefinite loop |
(c) | For loop | (iii) | Loop inside another loop |
(d) | While loop | (iv) | Termination The loop |
(e) | Break | (v) | Definite loop |
Answer:
(a) | Nested loop | (i) | Loop inside another loop |
(b) | Infinite loop | (ii) | Never editing loop |
(c) | For loop | (iii) | Definite loop |
(d) | While loop | (iv) | Indefinite loop |
(e) | Break | (v) | Termination The loop |
Explanation:
- Nested loop - A loop inside a loop is called a nested loop.
- Infinite loop - A loop that never terminates is called an infinite loop.
- For loop - The for statement is used to iterate over a range of values or a sequence . Hence it is a definite loop.
- While loop - The while statement executes a block of code repeatedly as long as the control condition of the loop is true. Hence, it is an indefinite loop.
- Break - The break statement alters the normal flow of execution as it terminates the current loop and resumes execution of the statement following that loop.