MCQ Practice Single Best Answer Topic: ICSE Computer Application - Class X - 2025 PYQ

Q Select the infinite loop:

Question ID
#24155
Subchapter
ICSE Computer Application - Class X - 2025 PYQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A for(int i=1; i<=10; i++)
  • B for(int i=2; i!=0; i-=3)
  • C for(int i=5; j<=5; j++)
  • D for(int i=1; i>=1; i--)
Correct Answer: B

Explanation

Correct Infinite Loop

Let's check the correct infinite loop:


for(int i=2; i!=0; i-=3)

Loop Breakdown:

  • Step 1: i = 2 (Condition i != 0 is true → executes)

  • Step 2: i -= 3 (Now i = -1)

  • Step 3: i != 0? Still true → executes again

  • Step 4: i -= 3 (Now i = -4)

  • Step 5: i != 0? Still true → executes again...

  • This never stops because i will always be != 0.

Correct Answer: (b) for(int i=2; i!=0; i-=3) (Infinite Loop)

Share This Question

Share this MCQ with your friends or study group.