MCQ
Single Best Answer
Moderate
QSelect the infinite loop:
ID: #24155
ICSE Computer Application - Class X - 2025 PYQ
124 views
Question Info
#24155Q ID
ModerateDifficulty
ICSE Computer Application - Class X - 2025 PYQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option 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(Conditioni != 0is true → executes) -
Step 2:
i -= 3(Nowi = -1) -
Step 3:
i != 0? Still true → executes again -
Step 4:
i -= 3(Nowi = -4) -
Step 5:
i != 0? Still true → executes again... -
This never stops because
iwill always be!= 0.
✅ Correct Answer: (b) for(int i=2; i!=0; i-=3) (Infinite Loop)
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic