Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.

Create Your Own Digital Clock In C Language
2 years ago
2
In this video we will learn about how to create a digital clock using c language
SOURCE CODE
#include <stdio.h>
#include <windows.h>
int main()
{
int h,m,s;
int d=1000;
// we add a delay of 1000 milliseconds and we will use it in the function sleep
printf("Set time : \n");
scanf("%d%d%d",&h,&m, &s);
if(h>12 || m>60 || s>60)
{
printf("ERROR ! \n");
exit(0);
}
while(1)
// this is an infinite loup and anything inside will repeat itself to infinity
{
s++;
if(s>59)
{
m++;
s=0;
}
if(m>59)
{
h++;
m=0;
}
if(h>12)
{
h=1;
}
printf("\n Clock :");
printf("\n d:d:d",h,m,s);
// this writes our time in this format 00:00:00
Sleep (d);
// the function sleep slows down the while loop and make it more like a real clock
system("cls");
// this clears the screen
}
}
Loading comments...
-
LIVE
Dear America
9 hours agoPam Bondi Announces NEW EPSTEIN FILES + Trump's First Speech To Congress!
4,340 watching -
LIVE
Wendy Bell Radio
4 hours agoDemocrats Think They're Still In Charge
7,559 watching -
42:37
Degenerate Jay
16 hours ago $1.95 earnedWhy The Wonder Woman Game Was Really Cancelled - Rejected Media
9.41K3 -
1:04:09
MTNTOUGH Fitness Lab
23 hours agoEpisode cover art John Eldredge: The Future of Christian Masculinity | MTNPOD #106
4.29K1 -
15:56
China Uncensored
18 hours agoChina Is Heading for Zero Births
9.87K15 -
13:27
TheRyanMcMillanShow
12 hours ago $0.44 earnedZoila Frausto Western Hunt Expo 2025
4.48K1 -
9:13
RTT: Guns & Gear
1 day ago $0.69 earnedThe ZRO Delta FKS-9 Is A Big ZERO
6.48K3 -
3:52:05
Akademiks
9 hours agoDay 3/30. Drake Drops lawsuit vs iHeartMedia? Offset and Cardi Calls it Quits. 50 v Jim Jones?
85.5K9 -
2:51:55
TimcastIRL
13 hours agoTrump Just FROZE ALL Ukraine Aid After Zelenskyy SCREWED Negotiations w/Viva Frei | Timcast IRL
242K90 -
9:54:54
Dr Disrespect
21 hours ago🔴LIVE - DR DISRESPECT - PUBG - 5 CHICKEN DINNERS CHALLENGE!
253K28