Guest User

Untitled

a guest
Apr 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main(){
  6. int horas, min, seg;
  7.  
  8. printf("Insira a informacao em segundos:\t");
  9. scanf("%i",&seg);
  10.  
  11. if (seg>=60){
  12.  
  13. min=seg/60;
  14. seg=seg%60;
  15.  
  16. }
  17. else if (seg<60){
  18.  
  19. min=0;
  20.  
  21. }
  22.  
  23. if (min>=60){
  24.  
  25. horas=min/60;
  26. min=min%60;
  27. }
  28. else if (min<60){
  29.  
  30. horas=0;
  31.  
  32. }
  33.  
  34. printf("\n\t%ih %im %is\n",horas, min, seg);
  35.  
  36.  
  37. return 0;
  38.  
  39. }
Add Comment
Please, Sign In to add comment