C | Operators | Question 3
#include <stdio.h> int main() { Â Â Â int i = (1, 2, 3); Â Â Â Â Â Â printf("%d", i); Â Â Â Â Â Â return 0; }
(A) 1
(B) 3
(C) Garbage value
(D) Compile time error
Answer: (B)
|
Explanation: The bracket operator has higher precedence than assignment operator. The expression within bracket operator is evaluated from left to right
but it is always the result of the last expression which gets assigned.
Please Login to comment...