Function for betting within blackjack program
So here is my problem. The betting function is the only part of my program not working right. I am sure it is something simple, but I am missing it.
1. keeps showing minimum bet message when betting over 10 which is wrong
2. doesn't loop correctly, if I put in an amount lower than 10 I get the right message, if I do it twice it just goes to playing which is wrong. I can enter the whole code if needed.
Code:
int betting() /*Asks user amount to bet*/
{
printf("\n\nEnter Bet: $");
scanf("%d", &bet);
for (bet >= 10002){ /*If player tries to bet more money than player has*/
printf("\nYou cannot bet more money than you have.\n");
return 0;
}
else if(bet <= 10){ /*If a player tries to bet under the minimum*/
printf("\nThe minimum bet at this table is 10 dollars.\n");
else printf("\nGood bet!!");
return 0;
}
}
else return bet;
} /*End Function*/