Skip to content

bashmohandes-ahmed/Guess-the-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Number Guessing Game (C)

Project Description:

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.

Features:

  • 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.

Requirements:

  • A C compiler (e.g., GCC)

How to Run the Program:

  1. 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).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages