Advertisement
Joao_Joao

Questão 38 Lista de Exercícios IFPB

Apr 30th, 2022
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.   int segundos;
  5.   printf("Digite um valor em segundos: ");
  6.   scanf("%d", &segundos);
  7.  
  8.   printf("%d segundo(s) equivale(m) a: ", segundos);
  9.   int horas = segundos / 3600;
  10.   segundos %= 3600;
  11.   int minutos = segundos / 60;
  12.   segundos %= 60;
  13.  
  14.   printf("%d hora(s) %d minuto(s) %d segundo(s)\n", horas, minutos, segundos);
  15.  
  16.   return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement