Developpement/23DEV1.1/TPS1/TP01/controle/Oeuf.c

30 lines
530 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int num;
int oeuf;
int douzaine;
int grosse;
printf("Combien d'oeufs ? ");
scanf("%d", &num);
oeuf = (num%12);
douzaine = (num/12)%12;
grosse = (num/12)/12;
if(oeuf>1){
printf("%d oeufs\n", oeuf);
}else{
printf("%d oeuf\n", oeuf);
}
if(douzaine>1){
printf("%d douzaines\n", douzaine);
}else{
printf("%d douzaine\n", douzaine);
}
if(grosse>1){
printf("%d grosses\n", grosse);
}else{
printf("%d grosse\n", grosse);
}
return EXIT_SUCCESS;
}