MCQ
Single Best Answer
Easy
QWhat is the output of the following C code?
#include
int main() {
int x = 5;
if (x > 10) {
printf("x is greater than 10");
}
else {
printf("x is less than or equal to 10");
}
return 0;
}
ID: #7200
Fundamentals of C Language
313 views
Question Info
#7200Q 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 B
Explanation
Answer: B
Explanation: The if statement checks if x is greater than 10, which it is not. Therefore, the code inside the else block is executed, resulting in the output "x is less than or equal to 10".
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic