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 / vijesh kumar

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[20],n,x,y,i,pos=0;
a[0]=1;
a[1]=3;
a[2]=4;
a[3]=5;
a[4]=6;
x=2;
y=1;
for(i=5+1;i>y;--i){
a[i]=a[i-1];
}
a[y]=x;
cout<<"\nAfter the inserting : ";
for(i=0;i<6;i++){
cout<<a[i]<<" ";
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if a pointer is deleted twice?

1225


Explain stack & heap objects?

995


What will the line of code below print out and why?

679


What is a vector c++?

1103


Is linux written in c or c++?

995


How is objective c different from c++?

1196


Difference between overloaded functions and overridden functions

1005


How long will it take to learn programming?

992


Which is the best c++ software?

1048


What is searching? Explain linear and binary search.

948


How does c++ structure differ from c++ class?

1056


What is an accessor in c++?

1022


How do you differentiate between overloading the prefix and postfix increments?

1043


Is swift faster than c++?

960


What is low level language in simple words?

978