Question:

The earth spins on its axis completing one rotation in a day. The earth moves around the sun in 365 days to complete one revolution. What is concept depicted in the given picture?

Show Hint

Whenever one repeated action happens inside another repeated action, think of a nested loop. A common example is days inside months or rotations inside revolutions.
  • Array
  • Condition
  • Nested loop
  • While loop
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Understand the two repeating motions shown in the picture.
The picture shows two repeating processes happening together:
  • The earth rotates on its own axis once every day.
  • The earth revolves around the sun once every year.
This means one repeated motion is happening inside another larger repeated motion.
Step 2: Relate this to programming logic.
In programming, when one loop works inside another loop, it is called a nested loop. Here, daily rotation can be compared to the inner loop, while yearly revolution can be compared to the outer loop. So, many rotations happen during one revolution, just like many inner loop executions happen during one outer loop cycle.
Step 3: Compare with the given options.
  • (A) Array: Incorrect. An array is a collection of elements, not a repeated process.
  • (B) Condition: Incorrect. A condition checks true or false, but the picture shows repetition.
  • (C) Nested loop: Correct. One repetitive activity is taking place within another repetitive activity.
  • (D) While loop: Incorrect. A while loop is a single loop, not a loop inside another loop.
Step 4: Conclusion.
Therefore, the concept shown in the picture is nested loop, because one cycle of motion takes place repeatedly inside another larger cycle.
Final Answer:Nested loop.
Was this answer helpful?
0
0

Questions Asked in ICSE Class X board exam

View More Questions