I did some studying and this is what I came up with. I am not sure what kind of setup I should have to find the remaining dimes, nickels and pennies. Please tell me if there is anything else wrong with the code, thanks.
Code:
#include <stdio.h>
void change(double, double *, double *, double *, double *);
double amount, quarters, dimes, nickels, pennies;
int main()
{
printf("Enter a dollar amount.");
scanf("%f", &amount);
change(amount, &quarters, &dimes, &nickels, &pennies);
printf("\nThe amount of quarters is: %6.2d\n", quarters);
printf("\nThe amount of dimes is: %6.2d\n", dimes);
printf("\nThe amount of nickels is: %6.2d\n", nickels);
printf("\nThe amount of pennies is: %6.2d\n", pennies);
return 0;
}
void change(double total, double *quarter, double *dime, double *nickel, double *penny)
{
*quart = total / .25;
*dime =