Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<unistd.h>
- int main()
- {
- int hour=0,sec=0,min=0,day=0;
- while(1)
- {
- if(sec==59)
- {
- min++;
- sec=0;
- }
- if(min==59)
- {
- hour++;
- min=0;
- }
- if(hour==24)
- {
- day++;
- hour=0;
- }
- sec++;
- printf("\n\n\n\t\t\t\tDIGITAL CLOCK\n\t\t\t\t %d : %d : %d\n",hour,min,sec);
- sleep(1);
- system("clear");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment