Practice mode C Language

Which operator has the lowest precedence of all operators in C?

Correct answer D. The comma operator

Explanation

The comma operator sits at the bottom of the C precedence table, below assignment, which is why a = 1, 2 assigns 1 to a and the whole expression has value 2. Assignment and ?: are just above it and associate right to left. Because of its low precedence, the comma operator often needs parentheses, as in x = (a, b), to have the effect you intend.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.