A simple Number Guessing Game written in C. The program generates a random number between 1 and 100, and the player must guess it. After each guess, the program provides feedback (too high, too low, or correct) until the correct number is guessed.
- Random number generation between 1 and 100.
- Provides feedback on guesses (too high / too low).
- Displays the number of attempts taken to guess the correct number.
- A C compiler (e.g., GCC)
- Clone this repository:
Navigate to the project directory: cd your-repository-name
Compile the program using GCC: gcc guess_game.c -o guess_game
Run the executable:
On Linux/Mac: ./guess_game
On Windows: guess_game.exe
sample output :
Welcome to the Number Guessing Game! Guess a number between 1 and 100
Enter your guess: 50 Too low!
Enter your guess: 75 Too high!
Enter your guess: 63 Too high!
Enter your guess: 58 Congratulations! You guessed the number in 4 attempts.
License: This project is open-source. Feel free to use, modify, or contribute to it.
Contributing: Fork this repository. Create your feature branch (git checkout -b feature-name). Commit your changes (git commit -am 'Add new feature'). Push to the branch (git push origin feature-name).