ashwini jayaraman
Member level 2
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,m,p,a[100];
clrscr();
printf("\n Enter any no: ");
scanf("%d",&n);
printf("\n Where do you want to insert? ");
scanf("%d",&m);
printf("\n No u want to enter? ");
scanf("%d",&p);
for(i=0;i<n;i++)
{
scanf("%d",&a);
}
for(i=n;i>=m-1;i++)
{
a=a[i-1];
}
a[m-1]=p;
for(i=0;i<=n;i++)
{
printf("%d",a);
}
getch();
}
This is my coding for insrtion at the middle
someone explain me this error
#include<conio.h>
void main()
{
int i,n,m,p,a[100];
clrscr();
printf("\n Enter any no: ");
scanf("%d",&n);
printf("\n Where do you want to insert? ");
scanf("%d",&m);
printf("\n No u want to enter? ");
scanf("%d",&p);
for(i=0;i<n;i++)
{
scanf("%d",&a);
}
for(i=n;i>=m-1;i++)
{
a=a[i-1];
}
a[m-1]=p;
for(i=0;i<=n;i++)
{
printf("%d",a);
}
getch();
}
This is my coding for insrtion at the middle
someone explain me this error