#include<stdio.h>
#include<conio.h>
main()
{
int n,a[100],i,j,d,*p,g;
printf("enter the size of array\n");
scanf("%d",&n);
printf("enter the elements of array\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);s
}
printf("enter the place to insert element\n");
scanf("%d",&d);
printf("enter the element to insert");
scanf("%d",&g);
p=&a[n];
for(i=n;i>=d;i--)
{
*p=a[i-1];
p--;
}
a[d-1]=g;
for(i=0;i<=n;i++)
{
printf("%d",a[i]);
}
getch();
}
#include<conio.h>
main()
{
int n,a[100],i,j,d,*p,g;
printf("enter the size of array\n");
scanf("%d",&n);
printf("enter the elements of array\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);s
}
printf("enter the place to insert element\n");
scanf("%d",&d);
printf("enter the element to insert");
scanf("%d",&g);
p=&a[n];
for(i=n;i>=d;i--)
{
*p=a[i-1];
p--;
}
a[d-1]=g;
for(i=0;i<=n;i++)
{
printf("%d",a[i]);
}
getch();
}
No comments:
Post a Comment