hi,
i'm having trouble with my char identifier in this code, i copied it below, i can't think of what is wrong. when i run it the characters that are returned are different then what i entered at the prompt (i put in ECL and the output was CBA);. If you can see anything wrong with my code please respond.
thanks!
emily
Code:
#include <stdio.h>
int main()
{
char first, middle, last;
int pennies, nickles;
int dimes, quarters;
int dollars;
int change;
int total_dollars;
int total_cents;
printf ("Please enter 3 initials:");
scanf ("%c%c%c", &first, &middle, &last);
printf ("\n%c%c%c, please enter your coin information.\n");
printf ("Number of one dollar coins:");
scanf ("%d", &dollars);
printf ("Number of quarters:");
scanf ("%d", &quarters);
printf ("Number of dimes:");
scanf ("%d", &dimes);
printf ("Number of nickles:");
scanf ("%d", &nickles);
printf ("Number of pennies:");
scanf ("%d", &pennies);
total_cents = 100*dollars + 25*quarters + 10*dimes + 5*nickles + pennies;
total_dollars = total_cents / 100;
change = total_cents % 100;
printf ("\n\n%c%c%c Coin Credit");
printf ("\nDollars:%d", total_dollars);
printf ("\nChange:%d change", change);
printf ("\nThank you for shopping at Robocop2 SuperFoods. Please present your hall pass.\n");
return(0);
}