Say I have an array (num[3]) that holds 3 numbers. How could I sort those numbers in order from highest to lowest and store them in individual integer variables (highest, middle, lowest) using C? For example:
And sort it so that highest = 9, middle = 5, and lowest = 4.Code:int num1 = 5; int num2 = 4; int num3 = 9; int num[3]; int highest, middle, lowest; num[1] = num1; num[2] = num2; num[3] = num3;