Skip to content

Instantly share code, notes, and snippets.

@gollilla
Last active May 23, 2018 23:53
Show Gist options
  • Save gollilla/dbc6d270c38c86fae6444cb34db6f5c3 to your computer and use it in GitHub Desktop.
Save gollilla/dbc6d270c38c86fae6444cb34db6f5c3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void){
// Your code here!
int data[] = {9, 14, 6, 42, 24, 7, 12};
int i,j,tmp,min;
for(i=0;i<=6;i++){
min = i;
for(j=i;j<=6;j++){
if(data[j] < data[min]){
min = j;
}
}
tmp = data[i];
data[i] = data[min];
data[min] = tmp;
}
for(i=0;i<=6;i++){
printf("%d\n", data[i]);
}
}
//https://paiza.io/projects/wmI8E-mAhPqSDrigjjvGWw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment