(Sep-03-2019, 05:51 PM)buran Wrote: one thing I think is wrong isleft = weight % 5
Do you know what modulo operator does?
I am not sure. I got help from an earlier post with the "%".
i want the program to findt the nearest 5. exampe. weight can not be 16.
so how I understood it was. 16 % 5 = 1 (count with your fingers 5 - 10 - 15.. 3 times, how much is left = 1)
and then you say 16(the weight)-(16 % 5) = 15
is that right?
How else could i write it? :)