🎴 Flashcard Mode

C Programming Fundamentals

Card1 / 12
Mastered0
Review0
QuestionClick to flip

void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } }

AnswerClick to flip back
A
Nothing is printed
💡 Explanation:

The comma operator evaluates all operands and returns the value of the last one. The expression (a,b,x,y) evaluates to y=0, which is false. Therefore, the if condition is false and nothing is printed. Note that void main() and missing return are not valid C but are accepted by some compilers as extensions.

Change Mode