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 the properties and principles of oop.
Where the memory to the static variables is allocated?
What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number
What is the best c++ book?
How should runtime errors be handled in c++?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
What is the difference between C and CPP?
Explain the term memory alignment?
What is else if syntax?
What does scope resolution operator do?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
What does flush do c++?
You run a shell on unix system. How would you tell which shell are you running?