LearnFrenzy
Sign in Take a free test

Operators and Expressions · Operators MCQ · Question 8

Value of a comma expression in C Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 8 Back to Exercise

What is the value of x after int x = (4, 7, 9);?

  • A 4
  • B 7
  • C 9 Correct
  • D 20
Correct Answer: Option C

The comma operator evaluates operands from left to right, discards all but the last, and yields the last one. The brackets matter: the comma has lower precedence than =.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links