#include <stdio.h>
int main()
{
printf("================Sorting===========\n");
int
A[5]= {31, 15, 20, 4, 5},i,j,tampung;
printf("Bella
1:\n");
for(i=0;i<5;i++){
printf("%10i",A[i]);
for (i=1;i<5;i++){
tampung
= A[i];
j=
i-1;
while
(A[j]>tampung && j>=0){
A[j+1]=A[j];
j--;
}
A[j+1]=tampung;
}
printf("\n\nBella
2:\n");
for
(i=0;i<5;i++){
printf("%10i",A[i]);
}
}
0 komentar:
Posting Komentar