my teacher gave us this question and i am totally confused on what to do. any help would be greatly appreciated.

Explain what is happening in the pseudo code LOOP in one word. What is temp referring to, and what is the final output for this program:

input (12, 25, 11, 28, 14)
BEGIN
temp := a_1
for i = 2 to n
if temp < a_i then temp := a_i
END
print temp
thank you for any help on this problem

2 answers

Temp is a temporary variable.

Lets see. It reads the first value, stores it in temp1, then it reads the next variable, tests it to see if it is greater than the first variable, if so, it replaces it, if not it reads the next data, and so on.
It appears to me it returns the greatest value from the set of data.
thanks for the help