0

Chocolates

Hi, could you please see my code named chocolates and tell me if there is anything wrong with it because when I put the numbers it appears 0. Thanks

24th Dec 2018, 12:45 AM
Nicolas Turk
Nicolas Turk - avatar
3 Answers
+ 3
You have to put cin command before the total variable declaration. Like this: int kg; float cant; cin >> kg; cin >> cant; float total=kg*cant ; float tot=total-(total/100*10); float to=total-(total/100*15); float t=total-(total/100*20);
24th Dec 2018, 1:43 AM
Sekiro
Sekiro - avatar
+ 1
Thanks!!
24th Dec 2018, 1:51 AM
Nicolas Turk
Nicolas Turk - avatar
+ 1
You are welcome!
24th Dec 2018, 1:54 AM
Sekiro
Sekiro - avatar