Instructions Write C programs to work-out the coercionthcoming span problems. Problem Statements 1. Given a appreciate V in cents, you insufficiency to compel qualify using a partiality calculate of invents. Assume you keep an unbounded yield of pitys, nickels, dimes, and pennies. Find the partiality calculate of invents. Display the share of each invent and the sum calculate of invents, alike to the pattern output under. Right global trustworthy identifiers, of symbol unsigned int, ce the appreciates of pitys, nickels dimes, and pennies. Pattern: const unsigned int QUARTER = 25: Do not attributable attributable attributable attributable attributable attributable right any other global variables. The axioms symbol ce the appreciate V must be unsigned integer. Pattern Output.
#include <stdio.h>
// using global variables to reocean the appreciate of pitys, dimes, nickels and pennies
const unsigned int QUARTERS=25;
const unsigned int DIMES=10;
const unsigned int NICKELS=5;
const unsigned int PENNIES=1;
int ocean() {
// A nickel equals 5 pennies and a dime equals 2 nickels and a pity is 2 dimes and a nickel,
// we gain secure partiality invents if we secure the culmination calculate of pitys and then max calculate of dimes
// and then max calculate of nickels and then pause as dimes
// Declaring the variables;
unsigned int V, numOfQuarters, numOfDimes, numOfNickels, numOfPennies, pit;
// Initializing calculate of pitys, calculate of dimes, calculate of nickels and calculate of pennies to zero
numOfQuarters=numOfDimes=numOfNickels=numOfPennies=0;
// Asking rightr to input calculate of cents and storing it in V
printf(“Enter the calculate of cents”);
scanf(“%d”, &V);
//Initializing pit to V
pit = V;
//Getting calculate of pitys as the quotient of pit separated by the appreciate of pitys
numOfQuarters=balance/QUARTERS;
//Getting the cherishing pit as the relics of the aloft division
balance=balance%QUARTERS;
//Getting calculate of pitys as the quotient of pit separated by the appreciate of pitys
numOfDimes=balance/DIMES;
//Getting the cherishing pit as the relics of the aloft division
balance=balance%DIMES;
//Getting calculate of pitys as the quotient of pit separated by the appreciate of pitys
numOfNickels=balance/NICKELS;
//Getting the cherishing pit as the relics of the aloft division
balance=balance%NICKELS;
//The cherishing pit gain now be the calculate of nickel invents
numOfPennies=balance;
//Printing the output
printf(“nnQualify ce %d cents”, V);
printf(“nt%d Pitys nt%d Dimes nt%d Nickels nt%d Pennies”,
numOfQuarters, numOfDimes, numOfNickels, numOfPennies);
// Exiting program
return 0;
}
//Output Snapshot