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
Explain public, protected, private in c++?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
What is encapsulation in C++? Give an example.
Explain the static member function.
What is the best c c++ compiler for windows?
What is general form of pure virtual function? Explain?
What is the best it certification?
How do you save a c++ program?
Is there a sort function in c++?
What is the C-style character string?
Do the parentheses after the type name make a difference with new?
What does override mean in c++?
What are c++ storage classes?
When are exception objects created?
What is a character in c++?