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 is the basic structure of a c++ program?

1163


How to access a variable of the structure?

1104


What is abstract keyword in c++?

1085


What gives the current position of the put pointer?

1012


Why is c++ not purely object oriented?

1020


What is ifstream c++?

1043


What are the advantage of using register variables?

1181


What is virtual destructor? What is its use?

1081


Write a program to interchange 2 variables without using the third one.

1070


How delete [] is different from delete?

1025


What is abstraction with real time example?

1170


Define a pdb file.

1086


Explain the problem with overriding functions

1172


Can we declare a base-class destructor as virtual?

1022


Describe about storage allocation and scope of global, extern, static, local and register variables?

1270