Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

Students also viewed these Programming questions

Question

What is a verb?

Answered: 1 week ago