Question 3 of 25
i
Which of the given options implies that there are two
loops that are nested?
1
Two loops, one after the other
2
Two loops, one inside the other
3
One loop with two different iteration counts
4
Two loops with the same iteration count
Answers
Answered by
2
Answer:
- Two loops, one inside the other. Option 2 is the right answer for the question.
Explanation:
- In programming, when we use one or more loop inside another loop, then it is called nested loop.
- We can have more than one loop inside the other.
- Nested loop is useful when we want to perform operation on matrices, create patterns and so on.
- The total number of iterations that happens inside nested loop is equal to the product of the number of iterations in each loop. For example, if outer loop runs 5 times and inner loop runs 2 times then, in total it runs 10 times.
- So, our answer is Option 2.
Answered by
0
(2) 2 loops , one i side the other.
Option (2) would imply that there are two loops that are nested.
As nested loop refers to the statement or loop present inside the another statement or loop.
It is used in complex programing or create patterns.
Similar questions