From 073fdde59e609e00c5c9b2b300c210f16c78c8a3 Mon Sep 17 00:00:00 2001 From: bastien Date: Sun, 16 Mar 2025 14:11:59 +0000 Subject: [PATCH] Ajouter Exo-2/main.c --- Exo-2/main.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Exo-2/main.c diff --git a/Exo-2/main.c b/Exo-2/main.c new file mode 100644 index 0000000..9a2ca1b --- /dev/null +++ b/Exo-2/main.c @@ -0,0 +1,44 @@ +#include +#include + +void ajouterContact(); +void afficherContacts(); + +int main() { + int choix = 0; + + do { + // Affichage du menu + printf("\n--- Gestionnaire de contacts ---\n"); + printf("1. Ajouter un contact\n"); + printf("2. Afficher tous les contacts\n"); + printf("3. Quitter\n"); + printf("Votre choix : "); + scanf("%d", &choix); + getchar(); // Pour absorber le retour à la ligne + + switch (choix) { + case 1: + ajouterContact(); + break; + case 2: + afficherContacts(); + break; + case 3: + printf("Au revoir!\n"); + break; + default: + printf("Choix invalide!\n"); + } + } while (choix != 3); + + return 0; +} + +void ajouterContact() { + // À compléter +} + +void afficherContacts() { + // À compléter +}