Question: For loop problem

Hi Guys, im wondering if you can help me with this for loop problem

so i have the array k[20,20], so it has 400 hundred entries, each entry has a number, but one entry has a number higher  then the others,

e.g. k[1,5]=6,k[1,6]=40,k[4,4]=20

so in the loop below i intend for the a and b element of the entry with the highest value to be assigned to tempa[2,1] and tempa[2,2], but i am not getting this outcome, please have a look

 

for(a=0;a<=20;a++)
for(b=0;b<=20;b++)
for(c=0;c<=20;c++)
for(d=0;d<=20;d++)
if (k[a,b]>k[c,d])
{

         {
               tempa[1,1]=a

               tempa[1,2]=b

               tempa[1,3]=k[a,b]



                   if(tempa[1,3]>tempb[2,3])
           {
               tempb[2,1]=tempb[1,1]

               tempb[2,2]= tempb[1,2]

               tempb[2,3]= tempb[1,3]

           }
  
          }

}

 

output(temp[1,3])

Please Wait...