Write an algorithm for the insertion sort using C?

#include<stdio.h>

#include<conio.h>

void main()

{

int i,j,k,temp;

int a[10] = {10,9,7,101,23,44,12,78,34,23};

clrscr();

printf(“\n printing sorted elemts\n”);

for(k=1;k<10;k++)

{

temp = a[k];

j=k-1;

while(j>=0 && temp <=a[j])

{

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

j=j-1;

}

a[j+1] = temp;

 

}

for(i=0;i<10;i++)

{

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

 

 

}

getch();

}

output:—–

printing sorted elements:-

7,9,10,12,23,2,3,34,44,78,101

thank you just write and implement good luck:-