output

Can anyone plz explain me the output of the following program
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
int main()

{

 int c=5;

 printf("%d\n%d\n%d", c, c <<= 2, c >>= 2);

 getchar();

}
It is undefined; the order of evaluation of expressions passed as parameter is not guaranteed to be one way or the other.
undefined behaviour is undefined
isn't C's calling convention from right to left???if not then can anyone explain me the output of the following

1
2
int a = 1 ;
printf ( "%d %d %d", a, ++a, a++ ) ;
The calling convention is not the same as the order of evaluation. The values of the parameters may be evaluated in any order regardless of the calling convention used.
Topic archived. No new replies allowed.