This is a c programdemonstrating Insertion Sort using C.

//This mode is to sort the elements in Insertion Sort order

#include

#include

#include

void main()

{

int a[500];

int key,i,j=2,n,k;

clrscr();

printf(“enter the size of array”);

scanf(“%d”,&n);

printf(“enter the elements\n”);

for(i=0;i

a[i]=random(n); //you can also input the value of numbers to be sorted

for(i=1;i

{ k=i;

key=a[i];

j=i-1;

while(j>=0 && key

{

a[j+1]=a[j];

k=j;

j–;

}

a[k]=key;

}

for(i=0;i

printf(“%d\t”,a[i]);

getch();

}

### OUTPUT

tags: c program for sorting technique , sorting using insertion sort , Insertion sort program in C, program in c for sorting