Iterating from MAX to 1 GCD is always between MAX and 1. The first GCD found will be the highest as we are decrementing the potential GCD
for ( int i = high ; i >= 1 ; i -- ) { int j = i ; counter = 0 ;