diff --git a/semaine-3/boolean/main.c b/semaine-3/boolean/main.c new file mode 100644 index 0000000..ff6c093 --- /dev/null +++ b/semaine-3/boolean/main.c @@ -0,0 +1,15 @@ +#include +#include + +int main(void) { + + int monAge = 47, majeur = monAge > 17; + + if (majeur) { + printf("Vous ĂȘtes majeur"); + } else { + printf("Vous ĂȘtes mineur"); + } + + return EXIT_SUCCESS; +} diff --git a/semaine-3/neurones/main.c b/semaine-3/neurones/main.c new file mode 100644 index 0000000..8ed30c0 --- /dev/null +++ b/semaine-3/neurones/main.c @@ -0,0 +1,22 @@ + +#include +#include + +#define PERTE 10000 +#define NEURONES 1000000000 +#define AGE 47 + +int main(void) { + + int restant = NEURONES + (AGE * -PERTE); + + if (restant < 99000000) { + printf("C'est mal parti !"); + } else if (restant > NEURONES) { + printf("Comment as-tu fais pour en gagner ?"); + } else { + printf("Ca devrait le faire."); + } + + return EXIT_SUCCESS; +} diff --git a/semaine-3/simple-choice/main.c b/semaine-3/simple-choice/main.c new file mode 100644 index 0000000..d14042a --- /dev/null +++ b/semaine-3/simple-choice/main.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(void) { + + char aPassword[30] = "SuperSecurePassword1234!", + uPassword[30] = "SuperSecurePassword1234 !"; + + if (!strcmp(aPassword, uPassword)) { + printf("Bienvenue"); + } else { + printf("Alerte"); + } + + return EXIT_SUCCESS; +}