Getting the wrong output

Sir, when i am executing the code the output is showing an addition of 1 but i am unable to figure out where i am wrong here can you please help me out


Sir and one more thing what if i want the output as the number of times a particular note is repeated for example if my answer is 2000 2000 2000 but i want it to be shown as 2000 * 3

sir i got my doubt solved but i wanted to know the code for the above condition in case i need the output to be shown as the multiples of the currency notes

hi @swaroop_stellar
ur code is giving the correct o/p only
2000
500
200
50
20
10
5
2
1

this sums up to 2788 only…

if u want this 2000 2000 2000 but u want it to be shown as 2000 * 3
then what u can do it maintain a frequency map, and when finally ans is computed print it…
i have made changes in ur code… it give o/p in the format u want…

hi @swaroop_stellar
i hope its clear now???

Thank you sir :relaxed: :innocent:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.