MCQ
Single Best Answer
Easy
QWhat is the output of the following C code?
#include
int main() {
int i = 0;
while (i < 5) {
printf("%d ", i);
i++;
}
return 0;
}
ID: #7201
Fundamentals of C Language
212 views
Question Info
#7201Q ID
EasyDifficulty
Fundamentals of C LanguageTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
Answer: A
Explanation: The while loop continues to execute as long as i is less than 5. Inside the loop, the value of i is printed using printf, and then incremented by 1. Therefore, the output will be "0 1 2 3 4".
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic