Beginner C: error: control reaches end of non-void function?
        Posted  
        
            by 
                Ting
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Ting
        
        
        
        Published on 2013-10-29T21:50:04Z
        Indexed on 
            2013/10/29
            21:54 UTC
        
        
        Read the original article
        Hit count: 249
        
Filed under: 
        c
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?
© Stack Overflow or respective owner