Advertisement
mahatma_xande

ex01lista06

Aug 28th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. /*
  2. It is a Timer! Enter the amount of minutes (m) and seconds (s).
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <windows.h>
  7.  
  8. int main(){
  9.  
  10.     int m, s;
  11.  
  12.     printf("Enter m, s: ");
  13.     scanf("%d %d", &m, &s);
  14.  
  15.     while(m > -1){
  16.         system("cls");
  17.         printf("time left (m:s): %2d : %2d\n", m, s--);
  18.         Sleep(1000);
  19.  
  20.         if(s == -1){
  21.             s = 59;
  22.             m--;
  23.         }
  24.     }
  25.  
  26.     printf("\nEnd!\n");
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement