Each and every float constant in C/C++ treated as double, because of this this program won't work as you expected. Add "f" like ".7f" after every float constant then it works as you expected.
Akash
Feb 6th, 2007
The output of the above programme will be b=0.5 .7 is not stored as 0.7 ie it is stired to some value which is slightly less that 0.7 so the control will not work as expected [this is the only excception i guess for floating point nos]
The answer is 2, because the statementi = (++i) / (i++)will be processed from left to righti = (++10) / (10++)which meansi = 11/10++Here still ++ operator is not executedi = 1++; // 1 because it is an integer operationi = 2;if you changei = (++i) / (++i) you will see 1