1) Math header not sure if i need it...
2) Function I am not sure on how to use it correctly...
3) Output did exactly what I was not supposed to do...
The book I am using has a bunch of exercises but no examples of the way I should format it or use the code. The only way I know if I am wrong is if the compiler tells me... lol
Code:
#include <stdio.h>
#include <math.h>
int main (int argc, const char * argv[])
{
int change(float);
float total;
int quarters, dimes, nickels, pennies;
printf ("Please enter your total value:");
scanf ("%f",&total);
quarters = total/.25;
dimes = total/.10;
nickels = total/.05;
pennies = total/.01;
printf ("Total Value Entered: %f \n",total);
printf ("%9d Quarters\n",quaters);
printf ("%9d Dimes\n",dimes);
printf ("%9d Nickels\n",nickels);
printf ("%9d pennies\n",pennies);
return 0;
}
Output
Code:
Total Value Entered: 4.000000
16 Quaters
40 Dimes
80 Nickels
400 pennies