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 ios flag in c++?

1203


What is the v-ptr?

1155


What is size_type?

1037


What is c strings syntax?

1135


Write about the access privileges in c++ and also mention about its default access level?

1050


How can I learn c++ easily?

1071


What is array give example?

1041


What is recursion?

2132


How is new() different from malloc()?

1113


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

1125


Explain overriding.

982


What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required

961


What are the differences between new and malloc?

1119


What are special characters c++?

1017


What is a literal in c++?

1091