/* The Insertion Sort Algorithm is implemented in this code */ #include int main() { int A[20]; int i,j; int temp; /*Read the elements from the user*/ for (i=0; i<20; i++) scanf("%d",&A[i]); /*Sort elements*/ for (i=0; i<20; i++) for (j=i+1; j<20; j++) if (A[i] > A[j]) { temp = A[i]; A[i] = A[j]; A[j] = temp; } /*Output the sorted array*/ for (i=0; i<20; i++) printf("%d ",A[i]); printf("\n"); return 0; }