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
Is c the same as c++?
Is std :: string immutable?
Why is null pointer used?
Explain the difference between realloc() and free() in c++?
What is an inclusion guard?
How long does it take to get good at leetcode?
what is c++
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
Explain shallow copy?
Explain "const" reference arguments in function?
Can a built-in function be recursive?
What is c++ map?
Write a program to add three numbers in C++ utilizing classes.
What does int * mean in c++?
Is python better than c++?