Guest User

Untitled

a guest
Jul 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int ConverterSegundos(int seg) {
  5. int hr, min, segundos, res[3];
  6.  
  7. res[0] = hr = (seg / 60) / 60; //Calculo das horas
  8. res[1] = min = (seg / 60) % 60; //Calculo dos minutos
  9. res[2] = segundos = seg % 60; //Calculo dos segundos
  10.  
  11. return res[0];
  12. }
  13.  
  14. int main(int argc, char** argv) {
  15. int segundos,horario[3];
  16.  
  17. printf("Digite os segundos: ");
  18. scanf("%d", &segundos);
  19. horario[0] = ConverterSegundos(segundos);
  20.  
  21. printf("ConversΓ£o para o formato %d:mm:ss n",horario[0]);
  22.  
  23. return (EXIT_SUCCESS);
  24. }
Add Comment
Please, Sign In to add comment