MCQ
Single Best Answer
Moderate
QIn a C++ for loop, what happens if the increment/decrement step is missing?
for (int i = 0; i < 10;) {
cout << i;
}
ID: #23076
For Loop in Programming Language
74 views
Question Info
#23076Q ID
ModerateDifficulty
For Loop in Programming LanguageTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option C
Explanation
In C++, if the increment or decrement step is missing, the loop will keep running indefinitely because the loop control variable will never change, and the condition will never become false. For example:
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic