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 / dhaivat

void arrayins(int arr[], int& n, int pos, int item)
{
if (n==MAX) //Size of array is MAX
cout<<"Overflow\n";
else
{
for (int x=n; x>=pos; x--)
arr[x+1]=arr[x];
arr[pos]=item;
n++;
cout<<item<<" inserted in the array\n";
}

Is This Answer Correct ?    17 Yes 47 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain public, protected, private in c++?

957


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

1004


What is encapsulation in C++? Give an example.

1023


Explain the static member function.

1114


What is the best c c++ compiler for windows?

996


What is general form of pure virtual function? Explain?

939


What is the best it certification?

1058


How do you save a c++ program?

982


Is there a sort function in c++?

932


What is the C-style character string?

1072


Do the parentheses after the type name make a difference with new?

1032


What does override mean in c++?

1012


What are c++ storage classes?

1040


When are exception objects created?

1015


What is a character in c++?

993