So I'm really new at this, i have an idea of whats going on, but my compiler keeps giving me errors. I need help please. Basically, I need to enter an amount of money and have the program spit out the amount in change that it is. For example $2.27, the program should say 8 quarters, 2 dimes, 1 nickels and 2 pennies.
CODE
#include<stdio.h>
int main()
{
int num;
int pennies;
int quarters;
int dimes;
int nickels;
printf("Enter the dollar amount: \n");
scanf("%d", &num);
quarters = (num % quarters);
dimes = num - (quarters*.25) % .1;
nickels = num - (quarters*.25) - (dimes*.10) % 0.05;
pennies = num - (quarters*.25) - (dimes*.10) - (nickels*.05) / pennies;
printf ("Your amount contain the following");
printf ("quarters: " ,quarters);
printf ("dimes: " ,dimes);
printf ("nickels: " ,nickels);
printf ("pennies: " ,pennies);
scanf("%d", &num);
return 0;
}
Any help would be appreciated.