My sincere recommendation is ... start again.
You have two nested loops, each time the DO-WHILE loop begins, the min and max values are set to zero, as the end-of-cycle condition for while is
values[min] > values[max]
can occur at any time or never happen, so we can have an infinite loop, also you are changing the values of the array itself so that your function can not serve in any way.
It is useful to use paper and pencil and see what happens with the values of the array and with the INDICES, it is important that you understand the value associated with an index can change, but not the index itself.
EDIT:
your idea of a DO WHILE loop combined with FOR is correct (not so your execution), we can use a control variable, which we can set to zero at the beginning of each WHILE iteration, then run a complete for loop, in order to perform the swaps of values needed in the array, if there is a change in the array we increase the counter, and we put as end condition of cycle while the counter is zero, when there are no more changes the counter is still zero and we leave the loop. .. I guess it is easier a small scheme of the code:
int count = 0;
do
{
count = 0;
for(......)
{
// if previous is greater than next swap
if(.....)
{
// we make the necessary changes in the ARRAY
count++;
}
}
}
while(count>0);