You've done the same thing both times and you expect different results :)
For ascending order, use "less" instead of "greater".
std::sort(a, a+size, std::greater<int>()); to
std::sort(a, a+size, std::less<int>());
i have just tried that but it still sends the number out ascending?
In line 52 change greater by less. And it will work, I promise :)