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 is the use of class in c++?

1086


Explain the static member function.

1189


What are put and get pointers?

1132


write a function signature with various number of parameters.

1047


What is buffering in c++?

1063


What are the unique features of C++.

1086


What do you understand by zombie objects in c++?

1102


Are c and c++ similar?

1056


What is polymorphism & list its types in c++?

1066


What are literals in C++?

1026


How do I run a program in notepad ++?

1112


Explain linear search.

1062


How can you quickly find the number of elements stored in a static array?

1099


What is #include iomanip?

1010


What new()is different from malloc()?

1111