Saturday, 18 May 2013

Insertion of an element at last of array

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10]={1,2,3,4,5};
int n;
printf("\nAt present elements of array are");
for(int i=0;i<=4;i++)
{
printf("\n%d",a[i]);
}
printf("\nEnter the element you want to insert");
scanf("%d",&n);
a[i]=n;
printf("\n New array after insertion is");
for(i=0;i<=5;i++)
{
printf("\n%d",a[i]);
}
getch();
}
full details in json
Proudly Powered by Blogger.
back to top