//Method 1 sort(v.begin(),v.end(),greater<>()); //Method 2 //Multiply the vector with -1 and then sort it and again multiply it with -1.