Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to insert an element into an array

Answer Posted / vinay kumar

#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int a[50],i,n,j,p;
cout<<"Enter the size of the array : ";
cin>>n;
cout<<"Enter the elements of the array :\n";
for(i=1;i<=n;i++)
{
cin>>a[i];
}
cout<<"Enter the new element to store : ";
cin>>j;
cout<<"Enter the postion : ";
cin>>p;
a[n+1]=a[p];
a[p]=j;
cout<<"The New series is : \n";
for(i=1;i<=n+1;i++)
{ cout<<a[i]<<"\t";
}
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by delegate? Can a user retain delegates?

884


Why do we use iterators?

1012


Tell me an example where stacks are useful?

983


What is a c++ class?

1045


What is the difference between prefix and postfix versions of operator++()?

1026


What is the use of setprecision in c++?

949


Describe about storage allocation and scope of global, extern, static, local and register variables?

1201


What is the full form of ios?

986


Is overriding possible in c++?

952


What is java and c++?

1098


Which c++ compiler is best?

1095


What is c++ code?

1072


What are the benefits of oop in c++?

1123


Explain how an exception handler is defined and invoked in a Program.

1119


Is rust better than c++?

1058