There are problems here. First, it only makes one pass through the array, so all it will do is push the largest value to the end. The rest of the list will likely not sort. Next, since i can increase to n-1, there's a problem. If i = n-1, then i+1 = n, which is beyond the end of the array. This is an error, but it usually won't report as an error. Instead, it will usually end up pushing the largest value past the end of the array and grabbing whatever data is there and pulling it into the last element in the array - usually a 0.
The c variable will record the number of swaps made, but nothing is ever done with it, so it can be removed.
There is a signature line for sort() in the middle of this code. This makes no sense to me, unless maybe it is an attempt to do a recursive call.
There are probably more issues, but this should get you back on track. If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)