Created
June 25, 2017 11:42
-
-
Save Ambratolm/b02d924baaa10e427ea88bb8eed3a1a8 to your computer and use it in GitHub Desktop.
Ecrire un algorithme qui convertit un nombre de secondes (entier seconde) en un nombre d’heure, de minutes et de seconds équivalents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
main() | |
{ | |
printf("______________________________________________________________\n"); | |
printf("Converteur de secondes en format: heures : minutes : secondes\n"); | |
printf("--------------------------------------------------------------\n"); | |
int X, H, M, S, R; | |
printf("\n"); | |
printf("Entrez le nombre de secondes: "); | |
scanf("%d",&X); | |
H=X/3600; | |
R=X-(H*3600); | |
M=R/60; | |
S=R-(M*60); | |
printf("--------------------------------------------------------------\n"); | |
printf("\n"); | |
printf("%d secondes = %d heures : %d minutes : %d secondes", X,H,M,S); | |
printf("\n"); | |
system("pause"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment