daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top