Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- It is a Timer! Enter the amount of hours (h), minutes (m) and seconds (s).
- */
- #include <stdio.h>
- #include <windows.h>
- int main(){
- int h, m, s;
- printf("Enter h, m, s: ");
- scanf("%d %d %d", &h, &m, &s);
- while(m > -1){
- system("cls");
- printf("time left (h:m:s): %2d : %2d : %2d\n", h, m, s--);
- Sleep(1000);
- if(s == -1){
- s = 59;
- m--;
- }
- if(m == -1){
- m = 59;
- h--;
- }
- }
- printf("\nEnd!\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement