Problem 1240. Coin change combinations.

Using only pennies (1), nickels (5), dimes (10), quarters (25), half dollars (50), and dollars (100), how many different combinations can be made from a given amount in cents.

Example 1:


%Output will be the the number of combinations of coins to make 17 cents.

c =


There are 6 combinations:

17 pennies

12 pennies and 1 nickel

7 pennies and 2 nickels

2 pennies and 3 nickels

7 pennies and 1 dime

2 pennies, 1 nickel, and 1 dime.

Example 2:


c =


Solution Stats

65.28% Correct | 34.72% Incorrect
Last solution submitted on Sep 07, 2016

Problem Comments

Solution Comments


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more