Files
DEV/DEV1.1/TP06/borne.c

29 lines
600 B
C
Raw Permalink Normal View History

2023-09-19 17:25:50 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int val1,val2,petit=10000,grand=-10000;
while(val1!=-1 || val2!=-1) {
printf("Donnez un entier : \n");
scanf("%d",&val1);
if (val1==-1)
break;
printf("Donnez un deuxieme entier : \n");
scanf("%d",&val2);
if (val2==-1)
break;
if (val1<val2){
if (val1<petit)
petit=val1;
if (val2>grand)
grand=val2;
}else{
if (val2<petit)
petit=val2;
if (val1>grand)
grand=val1;
}
}
printf("Le nombre le plus petit est %d et le plus grand est %d \n",petit,grand);
return EXIT_SUCCESS;
}