anyone know coding on how to count number of coins and notes? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

anyone know coding on how to count number of coins and notes?

//Example money= 51230 Number of Coins/Notes Thousand - 51 Five Hundred - 0 Hundred - 2 Fifty - 0 Twenty - 1 Ten - 1 Five - 0 Two - 0 One - 0

25th Feb 2017, 5:51 AM
newbie
2 Answers
+ 1
id use % int num = 8291; ones = num % 10; tens = num % 100 - ones hund = num % 1000 - tens -ones ... so on. you could also start from the highest, assuming you know a maximum and just go backwards. but just have num be the result
25th Feb 2017, 6:09 AM
Michael Szczepanski
Michael Szczepanski - avatar
0
Make divider rules first. Then count. You can check my post code.
25th Feb 2017, 6:10 AM
Albertz
Albertz - avatar