I'm trying to make a greedy algorithm and I get this error:
greedy2.c:27:1: error: control reaches end of non-void function
[-Werror,-Wreturn-type]
}
^
1 error generated.
with this code:
int man(int argc, char* argv[])
{
float amount;
do
{
printf("Input dollar amount owed:\n");
amount = GetFloat();
}
while (amount <= 0);
int coins = 0;
while (amount >= 0.25);
{
amount = amount - 0.25;
coins++;
}
printf("Number of coins to use: %d\n", coins);
}
What is wrong with my curly braces, and how do I fix it?