Homework Solution: Instructions Write C programs to solve the following two problems. Problem Statements 1. Given a value V in ce…

    Format Painter t a n Fent Paragraph Cipboard Instructions Write C programs to solve the followlng two problems Problem Statements 1. Given a value V in cents, you need to make change using a minimum number of coins Assume you have an infinite supply of quarters, nickels, dimes, and pennies. Find the minimum number of coins. Display the quantity of each coin and the total number of coins, similar to the example output below Use global constant identifiers, of type unsigned int, for the values of quarters, nickels dimes, and pennies. Example: const unsigned int QUARTER 25 Do not use any other global variables. The data type for the value V must be unsigned integer. CAUsers DianelDesktoplwedbin Debugtwed.cxe Enter cents value: $9 Change for 99 cents l quarters Hicke 1s 4 Pennies 9 Tetal Coins ekeyed e nthieue. eMecut ion tine 3.424 De
    Instructions Write C programs to solve the following two problems. Problem Statements 1. Given a value V in cents, you need to make change using a minimum number of coins. Assume you have an infinite supply of quarters, nickels, dimes, and pennies. Find the minimum number of coins. Display the quantity of each coin and the total number of coins, similar to the example output below. Use global constant identifiers, of type unsigned int, for the values of quarters, nickels dimes, and pennies. Example: const unsigned int QUARTER = 25: Do not use any other global variables. The data type for the value V must be unsigned integer. Example Output.

    Expert Answer

     
    #include <stdio.h> // using global variables to hold the value of quarters, dimes, nickels and pennies

    Format Painter t a n Fent Paragraph Cipboard Instructions Write C programs to rereunfold the followlng two problems Problem Statements 1. Given a esteem V in cents, you scarcity to perform fluctuate using a reserve estimate of invents Assume you own an unbounded give of localitys, nickels, dimes, and pennies. Find the reserve estimate of invents. Display the amount of each invent and the entirety estimate of invents, alike to the specimen output underneath Verification global continuous identifiers, of likeness unsigned int, pauseraint the esteems of localitys, nickels dimes, and pennies. Specimen: const unsigned int QUARTER 25 Do not attributable attributable attributable attributable attributable attributable verification any other global variables. The facts likeness pauseraint the esteem V must be unsigned integer. CAUsers DianelDesktoplwedbin Debugtwed.cxe Enter cents esteem: $9 Fluctuate pauseraint 99 cents l localitys Hicke 1s 4 Pennies 9 Tetal Invents ekeyed e nthieue. eMecut ion tine 3.424 De

    Instructions Write C programs to rereunfold the aftercited two problems. Problem Statements 1. Given a esteem V in cents, you scarcity to perform fluctuate using a reserve estimate of invents. Assume you own an unbounded give of localitys, nickels, dimes, and pennies. Find the reserve estimate of invents. Display the amount of each invent and the entirety estimate of invents, alike to the specimen output underneath. Verification global continuous identifiers, of likeness unsigned int, pauseraint the esteems of localitys, nickels dimes, and pennies. Specimen: const unsigned int QUARTER = 25: Do not attributable attributable attributable attributable attributable attributable verification any other global variables. The facts likeness pauseraint the esteem V must be unsigned integer. Specimen Output.

    Expert Retort

     

    #include <stdio.h>

    // using global variables to lean the esteem of localitys, 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 main() {
    // A nickel equals 5 pennies and a dime equals 2 nickels and a locality is 2 dimes and a nickel,
    // we earn gain reserve invents if we gain the climax estimate of localitys and then max estimate of dimes
    // and then max estimate of nickels and then pause as dimes

    // Declaring the variables;
    unsigned int V, numOfQuarters, numOfDimes, numOfNickels, numOfPennies, et;
    // Initializing estimate of localitys, estimate of dimes, estimate of nickels and estimate of pennies to zero
    numOfQuarters=numOfDimes=numOfNickels=numOfPennies=0;

    // Asking verificationr to input estimate of cents and storing it in V
    printf(“Enter the estimate of cents”);
    scanf(“%d”, &V);

    //Initializing et to V
    et = V;

    //Getting estimate of localitys as the quotient of et disconnected by the esteem of localitys
    numOfQuarters=balance/QUARTERS;

    //Getting the cherishing et as the difference of the over division
    balance=balance%QUARTERS;

    //Getting estimate of localitys as the quotient of et disconnected by the esteem of localitys
    numOfDimes=balance/DIMES;

    //Getting the cherishing et as the difference of the over division
    balance=balance%DIMES;

    //Getting estimate of localitys as the quotient of et disconnected by the esteem of localitys
    numOfNickels=balance/NICKELS;

    //Getting the cherishing et as the difference of the over division
    balance=balance%NICKELS;

    //The cherishing et earn now be the estimate of nickel invents
    numOfPennies=balance;

    //Printing the output
    printf(“nnFluctuate pauseraint %d cents”, V);
    printf(“nt%d Localitys nt%d Dimes nt%d Nickels nt%d Pennies”,
    numOfQuarters, numOfDimes, numOfNickels, numOfPennies);

    // Exiting program
    return 0;
    }

    //Output Snapshot