MCQ
Single Best Answer
Moderate
QWhat is the main advantage of using a while loop?
ID: #23089
While Loop in Programming Language
87 views
Question Info
#23089Q ID
ModerateDifficulty
While 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
The main advantage of a while loop is that it is ideal for situations where the number of iterations is unknown, and the loop should continue running as long as a specific condition remains true. This flexibility makes it useful for tasks like reading input from users, monitoring system states, or performing tasks that depend on external conditions. The other options are incorrect because while loops are not necessarily faster or more memory-efficient, and other loop types (like for loops) can also iterate through lists.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic