int x=3,y;
y=(++x*++x*++x)/++x;
the value of y=21and x=7
why?????????????????
int x=3,y;
y=(x++*x++*x++)/x++;
the value of y=9 and x=7
why?????????????????
int x=3,y;
y=(++x*++x*++x)/++x;
the value of y=21and x=7
why?????????????????
int x=3,y;
y=(x++*x++*x++)/x++;
the value of y=9 and x=7
why?????????????????
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
hi..
++x * ++x * ++x will be 150 .
take it like this…
((++x*++x)*++x) then divide it with 7.. u’ll get 21.. AND
post increment doesn’t make any effect in expression.. it only increase all the values at the end of expression.. thats why.. y=9 and at the end of expression x=7(Incremented later on, after division)
Cheers !!
In pre firstly increment the x and in first multiply the x maxm value is used 5 and output 25 thn increment 6 mul 150…further increase x value 7 thn divide…
In post the x value is same .in last x value increment.