[Solved] I cannot compare three numbers rigthly in C [closed]


I think when you write:

if (a > b) {
    max = a;
    min = b;
}
else (a < b); {
    max = b;
    min = a;
}

you really want to write:

if (a > b) {
    max = a;
    min = b;
}
else {
    max = b;
    min = a;
}

The compiler reads your code more like this

if (a > b) {
    max = a;
    min = b;
}
else 
    (a < b); 

{ max = b; min = a; }

6

solved I cannot compare three numbers rigthly in C [closed]