fin de TP06

This commit is contained in:
2023-09-19 17:25:50 +02:00
parent 7ea4eeae0b
commit b831fe17be
10 changed files with 103 additions and 0 deletions

29
DEV1.1/TP06/borne.c Normal file
View File

@@ -0,0 +1,29 @@
#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;
}