Guessing game: how to quit the game?

Home Forums C Programming Guessing game: how to quit the game?

This topic contains 1 reply, has 2 voices, and was last updated by  GWILouisaxwzkla 8 years, 11 months ago.

  • Author
    Posts
  • #2171

    Hello Everyone,
    I am writing a guessing game using for loop but did not know how to quite the game at any stage that I want. This is an example of my for loop:

    ………………………………………..
    case 1:
    askquestion_1( guesses, “nAttempt %d: Is your animal a dog? “, dog );
    break;
    case 2:
    askquestion_2( guesses, “nAttempt %d: Is your animal a mouse? “, mouse );
    break;
    …………………………………..

    How can i quiet after the first break. Can anyone help?

    Thanks.

  • #3503

    If your in the main function you could just use a return statement , I’d have to see the code , though…

You must be logged in to reply to this topic.

0 Shares
Share
+1
Tweet
Share
Stumble