#include <stdlib.h> #include <stdio.h> void select_sort(int a[], int n) { for(int i=0; i < n-1; i++) { int j = i; int smallest = a[j]; for(int k=i; k < n; k++) { if (a[k] < smallest) { j = k; smallest = a[k]; } } int t = a[i]; a[i] = a[j]; a[j] = t; } } int main() { int a[6] = {12,9,3,7,14,11}; select_sort(a, 6); for(int i=0; i < 6; i++) { printf("%d ", a[i]); } printf("\n"); return 0; }