I am trying to do a coin problem but I can't seem to get it to work. When I complie it, there are no errors and the program lets me enter a number and then does nothing. I can't figure out what I did wrong and if anyone can point me in the right direction it would be very appricaited.
Code:
#include <stdio.h>
int main()
{
int total=0;
int quart=0;
int dime=0;
int nick=0;
int pen=0;
{
printf ("\n Enter the total (in cents): ");
scanf(" %d, &total");
quart = total/25;
total = total - (quart * 25);
dime = total/10;
total = total - (dime * 10);
nick = total/5;
total = total - (nick * 5);
pen = total;
scanf("\n The change is:" );
if(quart != 0)
printf("\n %d qaurters ", quart );
if(dime != 0)
printf("\n %d dimes.", dime);
if(nick != 0)
printf("\n %d nickels", nick);
if(pen != 0)
printf("\n %d pennies ", pen);
}
return 0;
}