In array, an element with highest value is first located, it is then replaced with last element. The procedure is repeated for all elements in array except last, and after that for all of them except the last two etc... until only one element is left in array. Its called an Selection Sort. I have an example of it and a question under the first code.
I think i can explain.
I will start with the second loop
1 2 3 4 5
if (A[j] > A[Max]) Max = j;
float pom = A[i-1];
A[i-1] = A[Max];
A[Max] = pom;
what this does is simple it it checks if the j'th term is greater than the the j+1 th term.If it is then the the jth term gets switched with j+1 th term . the first loops sees to it that whole process repeats to the size of array (ie
it repeats to a time to that number of elements in the array) to sort it many number of times to make it correct.
A nested loop is a loop which is initialized inside other loop.If u r interested visit these sites to learn more about this::