Skip to content

jaiakash0786/number-guessing-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

number-guessing-game

#include #include #include using namespace std; class guess { int target; int choice; public: guess() { srand((unsigned int)time(NULL)); choice = (rand() % 10) + 1; target = 0;

    do {
        cout << "enter your guess (1-10): ";
        cin >> target;
        if (target > choice)
            cout << "just lower your guess" << endl;
        else if (target < choice)
            cout << "just higher your guess" << endl;
        else
            cout << "hurray ! you won the game !" << endl;

    } while (target != choice);
}

}; int main() { guess g1; return 0; }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published