Code: Select all
#include <stdio.h>
int main()
{
int x,y;
x=4;
y=x++ * ++x;
x=4;
printf("%d %d\n",y, x++ * ++x);
return 0;
}
25 25
but when I test :
25 24
please explain to me ?
Moderator: Board moderators
Code: Select all
#include <stdio.h>
int main()
{
int x,y;
x=4;
y=x++ * ++x;
x=4;
printf("%d %d\n",y, x++ * ++x);
return 0;
}
The nadir of Undefined Behaviour!Timo wrote:I have a code like this :Code: Select all
[...] y=x++ * ++x; x=4; printf("%d %d\n",y, x++ * ++x);