A simple and fun number guessing game written in C language.
- The game generates a random number between 1 and 100.
- It can be played by 2 or more players.
- Each player tries to guess the number in the fewest attempts possible.
- The game provides hints:
β€ "Think of a higher number" or
β€ "Think of a lower number"
Whoever guesses the number in the least number of tries wins!
- A random number is generated using
rand(). - Players take turns guessing the number.
- After each guess, the program tells whether the guessed number is too high or too low.
- When the correct number is guessed, the program displays the number of attempts taken.
- Language: C
- Libraries:
<stdio.h>β for input/output<stdlib.h>β for random number generation<time.h>β to seed the random number generator with the current time
- Clone the repository or download the
.cfile. - Compile the code using GCC or any C compiler:
gcc -o guess_game guess_game.c
Pull requests are welcome! Feel free to improve the game logic, add multiplayer score tracking, or create a UI version.
Vishal Verma (Inspired from @codewithharry)