X-Git-Url: https://git.piment-noir.org/?p=TD_C.git;a=blobdiff_plain;f=TP_13%2Fexo1%2Fsrc%2Fmain.c;h=2c81a631b28d3abb19c28c4eb6bf4d0ce3e0bd7f;hp=e7472189288080d542fbfb709d6a3f01a8eab848;hb=889d586254feccc26f294af86ce7e698ea006dfb;hpb=475ee86d70921638c700bc0934441c7fe2c905d1 diff --git a/TP_13/exo1/src/main.c b/TP_13/exo1/src/main.c index e747218..2c81a63 100644 --- a/TP_13/exo1/src/main.c +++ b/TP_13/exo1/src/main.c @@ -18,8 +18,8 @@ int main() { display_choice_menu(); errno = prompt_value("Choix?", &choice); handle_prompt_error(errno); - if (1 > choice || 5 < choice) { - printf("\nFaire un choix compris entre 1 et 5\n"); + if (1 > choice || 7 < choice) { + printf("\nFaire un choix compris entre 1 et 7\n"); continue; } switch (choice) { @@ -35,11 +35,17 @@ int main() { case 4: do_count(tab, tab_size); break; + case 5: + printf("\nLe nombre d'entiers pairs dans le tableau est %d\n", count_tab_criteria(tab, tab_size, is_even)); + break; + case 6: + printf("\nLe nombre d'entiers impairs dans le tableau est %d\n", count_tab_criteria(tab, tab_size, is_odd)); + break; default: /* do nothing, unused code path */ break; } - } while (choice != 5); + } while (choice != 7); free_tab(tab); exit(EXIT_SUCCESS);