/* * Homework 1, Problem 2: read a number, make change * Assignment: add an input routine */ #include int main(void) { int amount = 99; /* how much change do you need */ int nq, nd, nn; /* number of quarters, dimes, nickels */ /* YOUR CODE GOES HERE */ /* get the number of quarters and how much is left over */ nq = amount / 25; amount = amount % 25; /* get the number of dimes and how much is left over */ nd = amount / 10; amount = amount % 10; /* get the number of nickels and how much is left over */ nn = amount / 5; amount = amount % 5; /* what is left over is the number of pennies */ printf("%d quarters, %d dimes, %d nickels, %d pennies\n", nq, nd, nn, amount); return(0); }