Question
Farhan must pay a bill to a shopkeeper. The shopkeeper doesnt have any change, so Farhan must have all the notes required to pay the
Farhan must pay a bill to a shopkeeper. The shopkeeper doesnt have any change, so Farhan must have all the notes required to pay the bill. Write a C program that reads the bill and the number of each type of note (500, 100, 50, 20, 10, 5, 2, 1) from user and then output whether it is possible for Farhan to pay the bill or not. If it is possible, then also output the number of each notes required to pay the bill. Tentative Input/Output (bold ones are user inputs): Enter amount: 1175 Enter number of notes: 500: 1 100: 7 50: 1 20: 0 10: 5 5: 1 2: 0 1: 0 Farhan can pay the bill by using the following counts of different notes: 500: 1 100: 6 50: 1 20: 0 10: 2 5: 1 2: 0 1: 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started