> How would I determine the highest value out of 4 variables using if statements with pseudocode?

How would I determine the highest value out of 4 variables using if statements with pseudocode?

Posted at: 2014-12-18 
I have 4 variables containing integers and I need to use an if statement(s) to determine which is the highest number, using pseudocode.

if A > B then E := A else E:= B

if C > D then F:= C else F:= D

if E > F then G := E else G:= F

output G

declare an empty number variable called max

for (number of values)

{

if current number is greater than max

{

set max equal to current number

}

}

int maxOfFour (int a, int b, int c, int d) {

int lst[4];

lst[0] = a; lst[1] = b; lst[2] = c; lst[3] = d;

sort lst descending;

return lst[0];

}

I have 4 variables containing integers and I need to use an if statement(s) to determine which is the highest number, using pseudocode.