so i just started c# and found an exercise that says to sort the numbers in the array from small to big without using another array or change it to a 1D array this is what i did yet it does not work

for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 4; j++)
{
Min = test[i, j];
int o = 0;
lign = i;
col = j;
for (int h = i; h < 3; h++)
{
for (int z = j; z < 4; z++)
{
if (test[h, z] < Min)
{
Min = test[h, z];
lign = h;
col = z;
o = 1;
}
}
}
if (o == 1)
{
temp = test[i, j];
test[i, j] = test[lign, col];
test[lign, col] = temp;
}
}
}