This commit is contained in:
2023-10-24 15:42:53 +02:00
parent b77fecfee9
commit d770a781f8
6 changed files with 100 additions and 0 deletions

32
DEV1.1/CM1/exo3.c Normal file
View File

@@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
double taille;
int pouce, pouces,pied, pieds;
printf("Entrez votre taille :");
scanf("%lf",&taille);
taille*=100;
if ((taille/2.56)>1){
pouces=taille/2.56;
if ((pouces/12)>1){
pieds=pouces/12;
pouces-=pieds*12;
printf("%d pieds et %d pouces\n",pieds,pouces);
} else if ((pouces/12)>1 && (pouces-(pouces/12)==1)){
pieds=pouces/12;
pouces-=pieds*12;
printf("%d pieds et %d pouce\n",pieds,pouces);
} else if ((pouces/12)==1){
pied=pouces/12;
pouces-=pieds*12;
printf("%d pied et %d pouce\n",pied,pouces);
} else{
printf("%d pouces\n",pouces);
}
} else{
pouce=taille/2.56;
printf("%d pouce\n",pouce);
}
return EXIT_SUCCESS;
}