renix1

Informar quantos minutos tem determinada hora, em C

Feb 26th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. int main (void) {
  3.     //PERGUNTA PARA O USUARIO
  4.     int horasDesejadas = 0;
  5.     printf("Quantas horas voce quer saber? ");
  6.     scanf("%d", &horasDesejadas);
  7.     //ORGANIZANDO
  8.     printf("\n\n");
  9.     //EXIBIR HORA
  10.     unsigned long minutos = 60;
  11.     int horas = 1;
  12.     for (; horas <= horasDesejadas; horas++) {
  13.         horas == horasDesejadas ? printf("\nChegamos onde voce pediu\n"):printf("\nIremos continuar...\n");
  14.         printf("%u minuto(s):%02d hora(s)\n", minutos, horas);
  15.         minutos+=60;
  16.     }
  17.     return(0);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment