← All projects

Programming fundamentals

Number Guesser in C

A C console game with validated guesses, higher-or-lower hints, and an attempt counter.

AUDIENCEBeginners learning C input handling, conditions, and loops.
MEDIUM / TOOLSC
CURRENT STATEPublic project
01 / THE IDEA

Project overview

Number Guesser in C is a small console game and programming-fundamentals exercise. It accepts a guess, checks the input, reports whether the target number is higher or lower, and counts attempts. The source uses standard C input validation and a time-seeded target from 1 to 100.

02 / PEOPLE

Who it's for

Beginners learning C input handling, conditions, and loops.

03 / CONTEXT

Project context

A small console game can make basic input handling and control flow tangible.

04 / EXPERIENCE

Inside the project

  • Enter a guess and receive higher-or-lower feedback.
  • Validate input and count attempts until the target is found.
  • A small console exercise rather than a full product.
05 / APPROACH

The work

The C program validates guesses, gives higher-or-lower hints, and counts attempts.

06 / WALKTHROUGH

How it works

The program chooses a hidden integer between 1 and 100. Enter guesses and use the higher-or-lower feedback to narrow the range. On a correct answer, the program reports the number of valid attempts and ends the round.

07 / IMPLEMENTATION

Under the hood

The C source seeds rand with the current time, then uses a loop and conditional branches to compare guesses. scanf input is checked, out-of-range values are rejected, and invalid text is cleared from the input buffer. Only valid guesses count toward the attempt total. The project uses standard-library input, output, and random-number functions.

08 / SCOPE

What to know

This is a single-round console exercise in input validation and control flow. The pseudorandom target is appropriate for a small game, not security. The repository has no detailed README; the explanation is based on numberguesser.c on its first branch.

Read the repository and source ↗

Source reviewed 16 October 2026

09 / NOW

Current state

Public programming-fundamentals repository.