Advertisement
Xioth

C - TP3 - heure.c

Jan 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7.     time_t secondes;
  8.     struct tm instant;
  9.  
  10.     time(&secondes);
  11.     instant =* localtime(&secondes);
  12.  
  13.     printf("Il est actuellement : %d:%d:%d\n", instant.tm_hour, instant.tm_min, instant.tm_sec);
  14.     int nbMinutes = (instant.tm_hour-15)*60 + instant.tm_min;
  15.     printf("Il y a %d minutes que 15:00:00 est passe", nbMinutes);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement