C Programming :: Declarations and Initializations - Discussion
Home > C Programming > Declarations and Initializations > MCQs Questions Discussion
20 / 54
Choose the correct option.
Which of the following operators in 'C' does not associate from the left?
A+
B,
C=
D%
Answer: Option (Login/Signup)
Operator Precedence Chart
The below table describes the precedence order and associations of operators in C / C++ . Precedence of operator decreases from top to bottom.
Show Explanation
The below table describes the precedence order and associations of operators in C / C++ . Precedence of operator decreases from top to bottom.
Asked In ::
STEP-BY-STEP
The below table describes the precedence order and associations of operators in C / C++ . Precedence of operator decreases from top to bottom.
Read Full Answer
Report Error
Please Login First Click Here
STEP-BY-STEP
Here, the correct answer is '=' which is having associativity from right to left. Rest all other are having associativity from left to right. However, one can refer to the following table of precedence and associativity of various operators used in C.
Category | Operator | Associativity |
---|---|---|
Postfix | () [] -> . ++ - - | Left to right |
Unary | + - ! ~ ++ - - (type)* & sizeof | Right to left |
Multiplicative | * / % | Left to right |
Additive | + - | Left to right |
Shift | << >> | Left to right |
Relational | < <= > >= | Left to right |
Equality | == != | Left to right |
Bitwise AND | & | Left to right |
Bitwise XOR | ^ | Left to right |
Bitwise OR | | | Left to right |
Logical AND | && | Left to right |
Logical OR | || | Left to right |
Conditional | ?: | Right to left |
Assignment | = += -= *= /= %=>>= <<= &= ^= |= | Right to left |
Comma | , | Left to right |
Read Full Answer
Report Error
Please Login First Click Here