Average of three biggest parameters out of five without using sorting algorithm or vector/array
I would think, that you should try to divide and conquer rather than writing one long function. That means you should split your code into separable and reusable functions that do one thing. For example the individual minima you get by the following functions

float min2(const float&amp; a, const float&amp; b) {
    return a &lt; b ? a : b;
}

float min3(const float&amp; a, const float&amp; b, const float&amp; c) {
    const float temp = min2(a, b);
    return temp &lt; c ? temp : c;
}

float min4(const float&amp; a, const float&amp; b, const float&amp; c, const float&amp; d) {
    const float temp = min3(a, b, c);
    return temp &lt; d ? temp : d;
}   

float min5(const float&amp; a, const float&amp; b, const float&amp; c, const float&amp; d, const float&amp; e) {
    const float temp = min4(a, b, c, d);
    return temp &lt; e ? temp : e;
}


You might even put this into variadic templates and overload min.
Now you can get the minimum value and define a switch statement

float average3of3(const float&amp; a, const float&amp; b, const float&amp; c) {
    return (a + b + c)/3;
}

float average3of4(const float&amp; a, const float&amp; b, const float&amp; c, const float&amp; d) {
    const float min = min4(a, b, c, d);
    switch(min) {
        case a:
            return average(b, c, d);
        case b:
            return average(a, c, d);
        case c:
            return average(a, b, d);
        case d:
            return average(a, b, c);
    }
}

float average3of5(const float&amp; a, const float&amp; b, const float&amp; c, const float&amp; d, , const float&amp; e) {
    const float min = min5(a, b, c, d, e);
    switch(min) {
        case a:
            return average3of4(b, c, d, e);
        case b:
            return average3of4(a, c, d, e);
        case c:
            return average3of4(a, b, d, e);
        case d:
            return average3of4(a, b, c, e);
        case e:
            return average3of4(a, b, c, d);
    }
}