Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <stdio.h>
  4. int main ( ){
  5.     int totalSeconds;
  6.     int hours,minutes,seconds;
  7.  
  8.     printf("enter a number of seconds:  ");
  9.     scanf("%d", &totalSeconds);
  10.    
  11.     hours=  totalSeconds/(60*60);
  12.     minutes= totalSeconds%3600/60;
  13.     seconds= totalSeconds%60;
  14.    
  15.     printf("%d seconds represents: %d hours % minutes % seconds", totalSeconds,hours,minutes,seconds);
  16.  
  17.    
  18.    
  19.     getchar( );
  20.     getchar( );
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement