Please help me guys for ?? i am always confuse while i am facing a problem related to pre and post - increment & decrements operators in c ?? i know basic rule of pre and post increment but after this i am again facing problem to solve it .. foe example --
1.>
#include<stdio.h>
int main()
{
int x;
x=5;
printf("%d %d %d",++x + ++x + ++x);
return 0;
}
2.>
#include<stdio.h>
int main()
{
int x;
x=5;
printf("%d %d %d",x++ + x++ + x++);
return 0;
}
3.>
#include<stdio.h>
int main()
{
int x;
x=5;
printf("%d %d %d",++x , ++x , ++x);
return 0;
}
according to me its output will be 6 7 8 but it becomes 8 8 8 why ?? 4.>
#include<stdio.h>
int main()
{
int x;
x=5;
printf("%d %d %d",x++ , x++ , x++);
return 0;
}
according to me its output will be 5 6 7 but it becomes 7 6 5 why ??
Thank You guys.