Advertisement
Atheuz

Untitled

Sep 9th, 2011
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void)
  5. {
  6.     int input, intHour, intMin, intSec;
  7.  
  8.     printf("Give me a number: ");
  9.     scanf("%d", &input);
  10.     intHour = input / (3600);
  11.     input -= intHour * 3600;
  12.     intMin = ((input % 3600) / 60);
  13.     input -= intMin * 60;
  14.     intSec = ((input) % 60);
  15.  
  16.     printf("%d hour(s), %d minute(s), %d second(s)", intHour, intMin, intSec);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement