Hello,
I have following code snippet
When i calculated on my own i have answer as 4 5 5 4 5
and when i checked on compiler it gives different answer as 4 5 5 5 5
I know that in printf,its upto compiler that whether it evaluates using left to right or right to left,
but still it shows different behavior.
I have following code snippet
#include <stdio.h>
int main(int argc, char *argv[])
{
int i=5;
printf("%d %d %d %d %d\n",i++,i--,++i,--i,i);
return 0;
}
When i calculated on my own i have answer as 4 5 5 4 5
and when i checked on compiler it gives different answer as 4 5 5 5 5
I know that in printf,its upto compiler that whether it evaluates using left to right or right to left,
but still it shows different behavior.