Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- int main()
- {
- int delay,s,m,h;
- delay=1;
- printf ("Set your time (hh/mm/ss): ");
- scanf ("%d%d%d",&h,&m,&s);
- if (s>60 || m>60 || h>24)
- {
- system ("color 44");
- printf ("ERROR ! Wrong time");
- exit (0);
- }
- while (1)
- {
- s++;
- if (s>59)
- {
- s=0;
- m++;
- }
- if (m>59)
- {
- m=0;
- h++;
- }
- if (h>23)
- {
- h=0;
- }
- printf ("\nYour time : %02d : %02d : %02d",h,m,s);
- sleep(delay);
- system ("cls");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement