🎴 Flashcard Mode

Java and C Programming Fundamentals

Card1 / 20
Mastered0
Review0
QuestionClick to flip

What is the output of the following code snippet ?? void main() { int a = (2,4); printf("%d", a); }

AnswerClick to flip back
A
4
💡 Explanation:

The comma operator (2,4) evaluates expressions left-to-right and returns the value of the rightmost expression. Therefore, a receives the value 4, not 2 or 0.

Change Mode