Code:void main()
{
int i=10,j;
j=i++*i++;
printf("%d",j)
}
o/p
100
void main()
{
int i=10;
printf("%d",i++*i++);
}
o/p
110
why this o/p difference?anyone know?help me
Printable View
Code:void main()
{
int i=10,j;
j=i++*i++;
printf("%d",j)
}
o/p
100
void main()
{
int i=10;
printf("%d",i++*i++);
}
o/p
110
why this o/p difference?anyone know?help me
You are in the realm of undefined behaviour, as you read a variable twice in an expression where you also write it.
Incidentally, you might want to read more about main().
thank you laselight for your answer and good advice.