Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int ConverterSegundos(int seg) {
- int hr, min, segundos, res[3];
- res[0] = hr = (seg / 60) / 60; //Calculo das horas
- res[1] = min = (seg / 60) % 60; //Calculo dos minutos
- res[2] = segundos = seg % 60; //Calculo dos segundos
- return res[0];
- }
- int main(int argc, char** argv) {
- int segundos,horario[3];
- printf("Digite os segundos: ");
- scanf("%d", &segundos);
- horario[0] = ConverterSegundos(segundos);
- printf("ConversΓ£o para o formato %d:mm:ss n",horario[0]);
- return (EXIT_SUCCESS);
- }
Add Comment
Please, Sign In to add comment