#include<stdio.h>
main()
{
int A[9]={6,3,1,5,7,4,2,8,9};
int Temp, I, J, K;
printf("sebelum \n");
for(I=0; I<=9-1; I++) {
printf(" %d ", A[I]);
}
for(K=0; K <= 9; K++)
{ J = K;
for (I=K+1; I<=9-1; I++)
{ if (A[I] < A[J])
J = I;
}
Temp = A[J];
A[J] = A[K];
A[K] = Temp;
}
printf("\n");
printf("sesudah \n");
for (I=0; I<=9-1; I++) {
printf(" %d ", A[I]);
}
}
Maulana_1
0
Newbie Poster
Recommended Answers
Jump to Postlooks like a simple array sort to me. If so the pseudo code is already well known and you just have to match it to the details of this implementation
All 3 Replies
rproffitt
2,580
"Nothing to see here."
Moderator
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
rproffitt
2,580
"Nothing to see here."
Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.