DEV/DEV1.1/TP03/ordre.c

38 lines
585 B
C
Raw Normal View History

2022-09-27 16:14:04 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void){
double x=0;
double y=0;
double z=0;
printf("saisir trois nombres reels: ");
scanf("%lf %lf %lf",&y,&x,&z);
if (((x>y)&&(x>z))==1) {
if ((y>z)==1) {
printf("%lf>%lf>%lf",x,y,z);
}
else {
printf("%lf>%lf>%lf",x,z,y);
}
}
else {
if (((y>x)&&(y>z))==1) {
if ((x>z)==1) {
printf("%lf>%lf>%lf",y,x,z);
}
else {
printf("%lf>%lf>%lf",y,z,x);
}
}
else {
if ((y>x)==1) {
printf("%lf>%lf>%lf",z,y,x);
}
else {
printf("%lf>%lf>%lf",z,x,y);
}
}
}
return EXIT_SUCCESS;
}