APL/APL1.1/TP07/bornes.c

20 lines
356 B
C
Raw Permalink Normal View History

2021-09-28 15:59:07 +02:00
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int arg, min, max;
printf("Entrez des valeurs (-1 pour arreter) : ");
scanf("%d", &arg);
min = arg;
max = arg;
while(arg != -1) {
min = arg < min ? arg : min;
max = arg > max ? arg : max;
scanf("%d", &arg);
}
printf("Minimum : %d\nMaximum : %d\n", min, max);
return EXIT_SUCCESS;
}