work with this: we need to assign "maximum" an initial minimum value but we cant use Min_value. so next best option is to compare the first two input values after the initial N value and assign the greater out of them to "maximum" now initial input N has to be >0. so rest everything will go inside an "if N>0" inside that if N=1 then read that number and assign it to "maximum" and print it. else N has to be at least 2 or more. so compare the two input numbers and assign the greater out of two to "maximum" now all comes down to the for loop. for(int a=0; a<(N-2); a++) notice (N-2). that's because at this point you have already used the first two inputs. so if N was only 2 then the loop wont initiate. if lets say there are 5 inputs then the loop will go for 3 times for the remaining three inputs which you can compare and assign a value to "maximum" accordingly. After the loop just print the "maximum".