#include<stdio.h>//header file
#include<conio.h>//header file
void main() //starting of the main() function
{
int i,j,a[10],y; //declaration of the variables
clrscr();
printf("program that sorts the list of integers by insertion sort technique");
printf("\n\n\n\t\t------------INPUT-------------");
printf("\n\nenter the elements");//taking input from the user
for(i=0;i<5;i++)
scanf("%d",&a[i]);
for(i=1;i<5;i++)
{
y=a[i];
for(j=i-1;y<a[j] && j>=0;j--)
{
a[j+1]=a[j];
}
a[j+1]=y;
}
printf("\n\n\n\t\t------------OUTPUT------------");
printf("\n\nthe sorted list is:");
for(i=0;i<5;i++)//printing output
printf("%d ",a[i]);
getch();
}