MERGE 1D ARRAY

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[3],b[2],c[5],k=0;
for(int i=0;i<3;i++)
{
cin>>a[i];
}
cout<<“\n”;
for(int j=0;j<2;j++)
{
cin>>b[j];
}
for(int x=0;x<3;x++)
{
c[x]=a[x];
k++;
}
for(int y=0;y<2;y++)
{
c[k+y]=b[y];
}
cout<<“\n”;
for(int o=0;o<5;o++)
{
cout<<c[o];
}
getch();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s