29 lines
600 B
C
29 lines
600 B
C
|
|
#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;
|
||
|
|
}
|