This Number Guessing Game is a simple console-based game built in C, where the computer randomly selects a number between 0 and 100, and the user attempts to guess it. The game provides feedback after each guess, indicating whether the guessed number is too low or too high compared to the computer's chosen number. The game continues until the user guesses the correct number.
Once the correct number is guessed, the game congratulates the user and displays the number of attempts it took to guess the number. It's a fun and interactive way to sharpen your guessing ability and engage in friendly competition with friends to see who can guess the number in the fewest attempts!
Features - Random Number Generation: The computer randomly selects a number between 0 and 100. - User Interaction: The user inputs a guess, and the program provides feedback on whether the guess is too high or too low. - Track Attempts: The game counts and displays how many guesses it took the user to identify the correct number. - Two-Player Competition: Two friends can compete by taking turns to see who guesses the number with fewer attempts.
How to Play
- Run the C program.
- The computer will store a random number between 0 and 100.
- Enter a guess (between 0 and 100).
- The program will tell you if your guess is too low or too high.
- Keep guessing until you find the correct number.
- When the correct number is guessed, the program will congratulate you and display the total number of attempts.
Prerequisites A C compiler (e.g., GCC)
Installation and Setup - Clone the repository: bash : git clone https://github.com/supritkumar007/number-guessing-game.git
- Navigate to the project directory: bash : cd number-guessing-game
- Compile the program: bash : gcc number_guessing_game.c -o number_guessing_game
- Run the program: bash : ./number_guessing_game
Contributing Feel free to submit issues or pull requests to enhance the game with new features or improvements!