Fin du TP

This commit is contained in:
Simoes Lukas
2024-09-17 14:58:52 +02:00
parent 614213fed0
commit 5b32abb8ee
2 changed files with 258 additions and 0 deletions

24
DEV1.1/TP07/tests.c Normal file
View File

@@ -0,0 +1,24 @@
# include <stdlib.h>
# include <stdio.h>
int main(void) {
int saisie;
int min;
int max;
printf("Entrez un entier (-1 pour arrêter) ");
scanf("%d", &saisie);
min = saisie;
max = saisie;
do {
printf("Entrez un entier (-1 pour arrêter) ");
scanf("%d", &saisie);
if (saisie < min && saisie != -1) {
min = saisie;
}
if (saisie > max) {
max = saisie;
}
} while (saisie != -1);
printf("Minimum : %d Maximum : %d\n",min,max);
return EXIT_SUCCESS;
}