Discussion :: Operators and Expressions
-
What is the output of the following statements?
int i = 0;
printf("%d %d", i, i++);
Answer : Option B
Explanation :
Since the evaluation is from right to left.
So when the print statement execute value of i = 0
Since its execute from right to left when i++ will be execute first and print value 0 (since its post increment ) and after printing 0 value of i become 1.
So it its prints for 1 for next i.
Be The First To Comment