//My code prints all of the coins //I cannot seem to be able to use the variables that are inside the for loop, outside that loop. //Any Ideas?
int main(void)
{
float f;
do
{
printf("How much change is owed?\n");
f = GetFloat();
}
while( f < 0);
{
double round(double f);
int c = f * 100;
for(int quarters = 0 ; quarters == c % 25 ; quarters++)
{
int change = c / 25;
printf("%i\n", change);
}
for(int dime = 0; dime == c % 10; dime ++)
{
int change = c /10;
printf("%i\n", change);
}
for(int nickle = 0; nickle == c % 5; nickle ++)
{
int change = c / 5;
printf("%i\n", change);
}
for(int penny = 0; penny == c % 1; penny ++ )
{
int change = c / 1;
printf("%i\n", change);
}
}
}