//Escribir un programa que lea 3 números reales, y los ordene ascendentemente.
#include <stdio.h>
int main() {
    float a, b, c;

    printf("Introduce el primer, segundo y tercer número: \n");
    scanf("%f %f %f", &a, &b, &c);

    if (a <= b && b <= c) {
        printf("Orden: %.2f, %.2f, %.2f\n", a, b, c);
    } 
    else if (a <= c && c <= b) {
        printf("Orden: %.2f, %.2f, %.2f\n", a, c, b);
    } 
    else if (b <= a && a <= c) {
        printf("Orden: %.2f, %.2f, %.2f\n", b, a, c);
    } 
    else if (b <= c && c <= a) {
        printf("Orden: %.2f, %.2f, %.2f\n", b, c, a);
    } 
    else if (c <= a && a <= b) {
        printf("Orden: %.2f, %.2f, %.2f\n", c, a, b);
    } 
    else { // c <= b && b <= a
        printf("Orden: %.2f, %.2f, %.2f\n", c, b, a);
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: