1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
siniylev [52]
3 years ago
14

Write a C program that asks the user to enter a US dollar amount and then shows how to pay that amount using the smallest number

of $20,$10,$5 and $1 bills. Enter a dollar amount: 93
$20 bills: 4

$10 bills: 1

$5 bills: 0

$1 bills: 3
Computers and Technology
1 answer:
Eduardwww [97]3 years ago
8 0

Here is code in C.

#include <stdio.h>

//main function

int main(void)

{   //variable to store input amount

int amount;

printf("Enter a dollar amount:");

//reading the input amount

scanf("%d",&amount);

//calcutating and printing the $20 bills

printf("\n$20 bills:%d",amount/20);

//update the amount After reducing the $20 bills

amount=amount%20;

//calcutating and printing the $10 bills

printf("\n$10 bills:%d",amount/10);

 //update the amount After reducing the $10 bills

amount=amount%10;

//calcutating and printing the $5 bills

printf("\n$5 bills:%d",amount/5);

 //update the amount After reducing the $5 bills

amount=amount%5;

//calcutating and printing the $1 bills

printf("\n$1 bills:%d",amount/1);

return 0;

}

Explanation:

According to the code, first it will ask user to give input amount.Then it will find the total bills for $20 and print that number, then it update the amount value after reducing them from the amount.Then it will calculate total bills for $10 and print that number then it updates the amount after reducing them from amount.Similarly it will calculate for $5 bills and $1 bills and print their values.

Output:

Enter a dollar amount:93

bills of $20 :4

bills of $10 :1

bills of $5 :0

bills of $1 :3

You might be interested in
Write three tasks students can preform in a digital classroom?
Nadya [2.5K]

Students can perform several tasks in a digital environment. For example, they can watch instructional videos, take notes, and participate in peer discussions.

this is the right answer .just did it

7 0
3 years ago
Read 2 more answers
8. What is the order of growth execution time of the push operation when using the LinkedStack class, assuming a stack size of N
velikii [3]

The order of growth execution time of the push operation when using the LinkedStack class, assuming a stack size of N is; O(1)

<h3>Understanding Computer Programming Language</h3>

Let Top be the position of last element inserted in Array.

For Push operation, the process is as follows;

if(Top == last index of Array) {

Printf(“Stack Overflow”)

} else {

Top = Top + 1

a[Top] = element you want to insert

}

Read more about Computer Programming at; brainly.com/question/22654163

8 0
2 years ago
Which situation best describes the prosumer effect?
elena-s [515]

C

Explanation:

https://www.sciencedirect.com/science/article/pii/S2405844019356750

8 0
4 years ago
Moving through a neighborhood trying to locate open wireless access points is called ________.
disa [49]
<span>Moving through a neighborhood trying to locate open wireless access points is called wardriving. 
</span> The action wardriving is performed by a person in a moving vehicle (car, bike..) who is using a laptop or smartphone and wants to catch a Wireless LAN (WiFi) network. For this purpose there is software <span>freely available on the Internet.</span>
7 0
3 years ago
If you fail a course as a MAIN (residency) course, you can repeat that course as either a MAIN (residency) or an online (IG or I
Elina [12.6K]

Answer: False

Explanation:

The statement that "you fail a course as a MAIN (residency) course, you can repeat that course as either a MAIN (residency) or an online (IG or IIG) course" is false.

It should be noted that if one fail a course as a residency course, the course can only be repeated as a main (residency) course and not an online course. When a course is failed, such course has to be repeated the following semester and this will give the person the chance to improve their GPA.

5 0
3 years ago
Other questions:
  • Determine the value of base x of (211)x=(152)8
    8·2 answers
  • Create a lottery game application. Generate three random numbers (see Appendix D for help in doing so), each between 0 and 9. Al
    14·1 answer
  • Write program statements to determine the fewest number of bills needed to represent a total dollar amount.
    11·1 answer
  • The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:
    6·1 answer
  • Asking questions when something is unclear is part of
    5·1 answer
  • Pls help due tonight<br>Will give brainiest
    13·2 answers
  • What is another word for: a location in memory that contains a value?
    7·2 answers
  • Does nature behave the exact same way as fractals?
    15·1 answer
  • Why are business types of profession interrelated?​
    14·1 answer
  • Which of the following is true about main and secondary memory?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!