Denominations :- Given an amount, write a program to find the minimum number of notes of different denominations that sum up to the given amount. Available note denominations are 100, 50, 10, 1.
Fri Nov 04 2022 18:58:26 GMT+0000 (Coordinated Universal Time)
Saved by @codewithakash
Explanation For example, if the given amount is 893, in this problem you have to give the minimum number of notes that sum up to the given amount. Since we only have notes with denomination 100, 50, 10 and 1, we can only use these notes. Number of 100 notes 100 x 8 = 800 Number of 50 notes 50 x 1 = 50 Number off 10 notes 10 x 4 = 40 Number of 1 notes =1 x 3 = 3 *************** Total 893 --------- So the output should be 100:8 50:1 10:4 1:3
https://learning.ccbp.in/crash-course/coding/efd285cb-2566-4aea-b406-de162be87464
Comments