Bhaiya, you just changed the sign from less than to greater than in compare function to get the output in decreasing order, but how did you initially know that for a<b we will get in increasing order?
Compare function in swap function
Always, the first parameter is considered to be ordered according to second, so it is like a known convention that for sorting in increasing order you should use a < b