x
In[1]:= s = RandomReal[{0, 1}, 6]
Out[1]= {0.0983261, 0.814716, 0.152864, 0.588498, 0.39265, 0.60135}
In[2]:= sup = s[[1]];
For[j = 2, j <= n, j++, If[s[[j]] >= sup, sup = s[[j]]];];
In[4]:= sup
Out[4]= 0.0983261
In[5]:= sup = s[[1]];
n = Length[s];
For[j = 2, j <= n, j++, If[s[[j]] >= sup, sup = s[[j]]];];
In[8]:= sup
Out[8]= 0.814716