#include<iostream>
#include<conio.h>
using namespace std;
void accept(int a[],int l)
{
for(int i=0;i<l;i++)
cin>>a[i];
}
void display(int a[],int n)
{
int i;
for(i=0;i<n;i++)
cout<<a[i]<<" ";
}
void insertionsort(int a[],int n)
{
int i,value,hole;
for(i=1;i<n;i++)
{
value=a[i];
hole=i;
while((hole>0)&&(a[hole-1]>value))
{
a[hole]=a[hole-1];
hole--;
}
a[hole]=value;
}
cout<<"ARRAY IN SORTED ORDER:";
display(a,n);
}
int main()
{
cout<<endl<<endl;
cout<<"*****************************************************************************";
cout<<endl<<endl;
int a[6]={10,9,25,14,3,6},n;
cout<<"SIZE OF ARRAY:";
cin>>n;
cout<<"ENTER ARRAY:";
accept(a,n);
cout<<endl;
insertionsort(a,n);
cout<<"\n*****************************************************************************";
getch();
return 0;
}