--- In [email protected], Uday Oberio <uday_obe...@...> wrote: > > per=(sum/500)*100;
If sum is an int, then (sum/500) is calculated using integer arithmetic, so if sum<500 then sum/500==0. You could change it to: per = (sum / 500.0) * 100; to force a floating point division.
