ok quick fix but far from perfect you shouldn't really use scanf.... better would be fgets() and use atof() and atoi() to convert string input to numbers.
anyway:-
Code:
#include <stdio.h>
/* change values */
#define HALFDOLLARS .50
#define QUARTERS .25
#define DIMES .10
#define NICKLES .05
#define PENNIES .01
int main(void)
{
char response[10]={0};
while (response[0] != 'n') {
int halfdollars_num = 0,
quarters_num = 0,
dimes_num = 0,
nickles_num = 0,
pennies_num = 0;
double total_change = 0.0;
/* ask and enter the number of coins */
printf("\nEnter the number of Half-Dollars in the drawer: ");
scanf("%d", &halfdollars_num);
printf("\nEnter the number of quarters in the drawer: ");
scanf("%d", &quarters_num);
printf("\nEnter the number of dimes in the drawer: ");
scanf("%d", &dimes_num);
printf("\nEnter the number of nickles in the drawer: ");
scanf("%d", &nickles_num);
printf("\nEnter the number of pennies in the drawer: ");
scanf("%d", &pennies_num);
/* calculate */
total_change += (double)(quarters_num * QUARTERS);
total_change += (double)(halfdollars_num * HALFDOLLARS);
total_change += (double)(dimes_num * DIMES);
total_change += (double)(nickles_num * NICKLES);
total_change += (double)(pennies_num * PENNIES);
/* print total change */
printf("\nTotal change = %2.2f\n", total_change);
/* ask if the user wants to do it again */
printf("\nDo you want to process another drawer? ");
scanf("%s", &response);
}
return 0;
}