Insertion using functions in C++

This program inserts a given number into an integer array. The location is also taken from the user.

[code='cpp']#include
void insert_array(int, int, int,int []);
void main()
{
int a[20],x,loc,n;
cout<<"Enter the number of elements";
cin>>n;
for(int i = 0;i cin>>a[i];

cout<<"Enter the number and location";
cin>>x>>loc;
insert_array(x,loc,n,a);
}
void insert_array(int x,int loc,int n,int a[])
{
int b;
loc--;
if(n<19)
{
b=n;
while(b {
a[b]=a[b-1];
b--;
}
a[loc]=x;
for (int i=0;i cout< }
}

[/code]