help on vol of sphere
Hi everyone,
im new on java..
currently reading ch2
there's this execrise at the end of ch2 which i dun quite get it
pg75 Q4
here's goes:
nSunVol = (long) (Math.PI * Math.pow ((nSunDia /2), 3) * 4/3);
nSunVol = (long) (4/3 * Math.PI * Math.pow ((nSunDia /2), 3));
it seen to me tat if i code it as L1 the ans is correct.
but when i coded it in L2 by switching the 4/3 to the front. It doesnt work.
Can anyone explain to me y?
thx
|