Programming Assignment 5

Coin change problem

You have an infinite supply of 100 rupees, 50 rupees, 10 rupees, 5 rupees and 1 rupee currency (say you are the chief cashier). For an amount N (positive), you want to disburse it in one of the many ways. For instance, for N = 125, some of the possibilities are 100 + 10*2 + 5, 100 + 5*5, 50*2 + 10*2 + 5, 10*12 + 5 etc.

(i) Write a program that enumerates all the possibilities (not just count but actually list out all the solutions) given a value N. Your program should be based on recursive calls.

(ii) Repeat the same, where your program does not make use of recursive calls.