hi. i am having problem with the loop in my program. i am only a beginner and struggling with c program. i hope to pass this course so please help me.
PROBLEM: when ever i enter a 'y' in the loop, the loop continues but i want it to ask if i want to play again in between. here is my code:
the output should be:
Code:
Would you like to play inBetween [y|n]? y
Die 1: 2 Die 2: 8
Not the same, let's play!
Number of chips: 100
Place your bet: 10
Die 3: 5
*** You win! ***
You now have 110 chips!
Play again [y|n]? y
Die 1: 1 Die 2: 10
Not the same, let's play!
Number of chips: 110
Place your bet: 10
Die 3: 5
*** You win! ***
You now have 120 chips!
Play again [y|n]? y
Die 1: 9 Die 2: 9
Even-steven - let's play again!
Play again [y|n]? y
Die 1: 3 Die 2: 5
Not the same, let's play!
Number of chips: 120
Place your bet: 20
Die 3: 6
*** Sorry - You lose! ***
You now have 100 chips!
Play again [y|n]? n
Thanks for playing!
any help would be appreciated