G
Guest
I can not figure out what I'm doing wrong. I'm trying to calc a percent by
dividing a small number by a large number, but result always = 0.
This is what I have.
double nbr1
double nbr2
int pct
nbr1 = 180
nbr2 = 500
pct = (nbr1 / nbr2) * 100
The pct always = 0 and it should be 36. Can anyone tell me what I'm doing
wrong.
Thanks in advance.
--
dividing a small number by a large number, but result always = 0.
This is what I have.
double nbr1
double nbr2
int pct
nbr1 = 180
nbr2 = 500
pct = (nbr1 / nbr2) * 100
The pct always = 0 and it should be 36. Can anyone tell me what I'm doing
wrong.
Thanks in advance.
--