Ok... here's the code revision I did in message #8 with a little revision to stop you from starting with extra quarters...
Also note that I've amalgamated the printf() calls from each function into Main() reducing your code size somewhat.
I also corrected your broken main() function so it actually returns a value at the end.
Code:
int slot1(int, int );
int slot2(int, int );
int slot3(int,int);
double convertQuarters (int);
int main (void)
{
int rounds = 0;
int input3;
double x;
int coins = 1000; // start with 1000 quarters
while(coins)
{
++rounds;
coins = slot1(rounds, --coins );
coins = slot2(rounds, --coins );
coins = slot3(rounds, --coins );
printf ("You have %d quarters left\n", coins);
printf ("Your winnings are $%.2lf\n", convertQuarters(coins));
printf("Press Enter to play again..."
getchar();
}
return 0;
}
int slot1(int timesPlayed, int quarters)
{
printf ("Slot Machine One\n");
if (! timesPlayed%33)
{
printf("You won on slot machine 1\n");
quarters+=25;
}
return quarters;
}
int slot2(int timesPlayed, int quarters)
{
printf ("Slot Machine Two\n");
if (! timesPlayed%99)
{
printf("You won on slot machine 2\n");
quarters+=75;
}
return quarters;
}
int slot3(int timesPlayed, int quarters)
{
printf ("Slot Machine Three\n");
if (! timesPlayed%9)
{
printf("You won on slot machine 3\n");
quarters+=25;
}
return quarters;
}
double convertQuarters (int quarters)
{
double result;
return quarters*0.25;
}