Guessing Game problem...

Discussion in 'C' started by blorgit, Aug 28, 2010.

  1. blorgit

    blorgit New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    <div>Heya. I'm having a problem with my guessing game. It won't stop guessing even after getting the right answer, and it also prints both questions no matter what the user input is. The guessing game is one where the computer guesses the user's number...any help?

    #include
    #define max 200

    main()
    {
    int x, guesses, low, high, mid;
    char response;
    size=max;
    x=100;
    low=1;
    high=max;
    mid=(low+high)/2;
    printf ("Pick an integer from 1 to 200 and I will guess it.");
    printf ("Respond with y is I'm right, n if I'm wrong.\n");
    printf ("I will attempt to guess nine times.");
    while (low
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice