20 lines
356 B
C
20 lines
356 B
C
#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;
|
|
} |