Computers and Technology, 17.06.2021 20:30 Tnaaasty5901
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
Answers: 1
Computers and Technology, 22.06.2019 02:00
What is the largest decimal number that can be represented by a binary number with 4 place values? (remember, each place in a binary number has a value of a power of 2, starting in the ones place with 20.)
Answers: 3
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
Computers and Technology, 23.06.2019 22:20
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
Write a program with total change amount as an integer input, and output the change using the fewest...
English, 10.09.2019 18:30
History, 10.09.2019 18:30
Mathematics, 10.09.2019 18:30
World Languages, 10.09.2019 18:30
Mathematics, 10.09.2019 18:30
Mathematics, 10.09.2019 18:30
Geography, 10.09.2019 18:30
Mathematics, 10.09.2019 18:30