2021-10-18 09:44:34 +02:00
|
|
|
/* La Majorité */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int est_majeur(int);
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int age;
|
|
|
|
|
|
|
|
printf("Quel est votre âge ? ");
|
|
|
|
scanf("%d", &age);
|
|
|
|
|
2021-10-18 10:04:15 +02:00
|
|
|
if (est_majeur(age)) {
|
2021-10-18 09:44:34 +02:00
|
|
|
printf("Vous êtes donc majeur.\n");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
printf("Vous êtes mineur.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int est_majeur(int age) {
|
|
|
|
if (age >= 18) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|