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) {
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);