for int for int if arr arr int tmp arr arr arr arr tmp

1
2
3
4
5
6
7
8
9
for (int k = 0; k < n - 1; k++) {
for (int j = 0; j < n - 1; j++) {
if (arr[j+1] > arr[j]) {
int tmp = arr[k];
arr[k] = arr[j];
arr[j] = tmp;
};
};
};