A simple, aesthetically pleasing Digital Clock built using C language that displays the current hours, minutes, and seconds in a large digital format directly in the Windows console. The clock updates every second using system time.
- ⏱ Real-time Accuracy: Displays system time with second-level precision.
- 🔢 Custom ASCII Art: Large 7-segment display style digits rendered seamlessly.
- 🔁 Live Updates: Auto-refreshes every second without flickering.
- 🪟 Windows API Integration: Uses
windows.hfor efficient cursor positioning (gotoxy). - 💡 Clean Code: Well-structured and commented C code, perfect for beginners.
- Language: C
- Platform: Windows (Command Prompt / PowerShell)
- Libraries:
stdio.h(Standard I/O)windows.h(Console manipulation)time.h(Time functions)
- Time Fetching: Retrieves the current system time using
time()andlocaltime(). - Digit Extraction: Separates hours, minutes, and seconds.
- Rendering Engine:
- Each digit (0-9) is drawn using custom ASCII patterns.
gotoxy()places the cursor at specific coordinates to print digits side-by-side.
- Loop & Sleep: The main loop refreshes the display every 1000ms (
Sleep(1000)).
- A C Compiler (GCC recommended, e.g., MinGW).
- Windows OS.
-
Clone the Repository (or download the zip):
git clone https://github.com/NANDGOPALSHARMA-29/Digital-Clock.git cd Digital-Clock -
Compile the Code: Open your terminal in the project folder and run:
gcc clock.c -o clock.exe
-
Run the Application:
./clock.exe
clock.c: The core logic and ASCII art definitions.README.md: Project documentation.
Contributions are welcome! Feel free to open an issue or submit a pull request.