using System;
class SelectionSortExample {
static void Main() {
int[] numbers = { 99, 44, 6, 2, 1, 5, 63, 87, 283, 4, 0 };
SelectionSort(numbers);
Console.WriteLine("Sorted Array:");
Console.WriteLine(string.Join(", ", numbers));
}
static void SelectionSort(int[] arr) {
for (int i = 0; i < arr.Length - 1; i++) {
int lowestValueIndex = i;
for (int j = i + 1; j < arr.Length; j++) {
if (arr[j] < arr[lowestValueIndex]) {
lowestValueIndex = j;
}
}
int temp = arr[lowestValueIndex];
arr[lowestValueIndex] = arr[i];
arr[i] = temp;
}
}
}