#include<stdio.h>
void main()
{
int i,j;
i=3;
j=++i*++i*++i;
printf("%d\n",j);
}
Now when I executed this code I got 216 (as expected). But I got this output in window's Turbo C compiler
only. When I tried executing it on Ubuntu I got 150 :-/ :-/.
And I also tried many chngs in this code,so when I chng it to j=++i*(++i*++i);
I got 216 in ubuntu compiler also. And for j=++i*++i; its giving the correct output,i.e, 25.
So someone please explain me why this is happening? I am using ubuntu 11.04 (Natty narwhal) and gcc compiler.

New Topic/Question
Reply



MultiQuote





|