IvoSilva

[PROG1] Ficha 7 | Exercício 5

Nov 26th, 2011
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. int horasMin (int total , int *horas , int *minutos)
  3. {
  4.     *horas = total / 60 ;
  5.     *minutos = total % 60 ;
  6.     if (total > 1440) return 1 ;
  7.     else return 0 ;
  8. }
  9. int main ()
  10. {
  11.     int total , horas , minutos ;
  12.     printf ("Insira o total de minutos : ") ;
  13.     scanf ("%d" , &total) ;
  14.     if (horasMin (total , &horas , &minutos)) printf ("%d minutos correspondem a %dh : %dmin e é superior a 1 dia!\n" , total , horas , minutos) ;
  15.     else printf ("%d minutos correspondem a %dh : %dmin e não é superior a 1 dia!\n" , total , horas , minutos) ;
  16.     return 0 ;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment