subject

Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is:0 or less than 0, the output is:No change Ex: If the input is:45the output is:1 Quarter2 Dimes Fix code please getting error on code#include #include int main(){int coin, dollar, quarter, dime, nickel, penny, rem;scanf("%d\n",&coin);if(coin <=0){printf("No change\n");}else{// calculate Dollersdollar = coin/100;rem = coin%100;if(dollar<=1){printf("% d Dollar\n", dollar);}else{printf("%d Dollars\n", dollar);}// calculate Quartersquarter= rem/25;rem= rem%25;if(quarter<=1){printf("%d Quarter\n", quarter);}else{printf("%d Quarters\n", quarter);}// calculate Dimesdime= rem/10;rem= rem%10;if(quarter<=1){printf("%d Dime\n", dime);}else{printf("%d Dimes\n", dime);}// calculate Nickelsnickel= rem/5;rem= rem%5;if(nickel<=1){printf("%d Nickel\n", nickel);}else{printf("%d Nickels\n", nickel);}// calculate Penniespenny= rem;if(penny<=1){printf("%d Penny\n", penny);}else{printf("d Pennies\n", penny);}return 0}ERROR below: Compare outputkeyboard_arrow_up0 / 2Output differs. See highlights below. Special character legendInput45Your output0 Dollar 1 Quarter 2 Dime 0 Nickel 0 PennyExpected output1 Quarter 2 Dimes2: Compare outputkeyboard_arrow_up2 / 2Input0Your outputNo change3: Compare outputkeyboard_arrow_up0 / 2Output differs. See highlights below. Special character legendInput156Your output1 Dollar 2 Quarters 0 Dimes 1 Nickel 1 PennyExpected output1 Dollar 2 Quarters 1 Nickel 1 Penny4: Compare outputkeyboard_arrow_up0 / 2Output differs. See highlights below. Special character legendInput300Your output3 Dollars 0 Quarter 0 Dime 0 Nickel 0 PennyExpected output3 Dollars

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 22:00
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass.cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array.c . run this program and observe the results.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
You know the right answer?
Write a program with total change amount as an integer input, and output the change using the fewest...
Questions
question
Mathematics, 10.12.2020 17:00
question
Mathematics, 10.12.2020 17:00
question
Mathematics, 10.12.2020 17:00
Questions on the website: 13722360