MERGE 2D ARRAY AND REVERSING IT

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[4],b[6],c[10],d[10],i,j,k;
cout<<“Enter First array :\n”;
for(i=0;i<4;i++)
{
cin>>a[i];
}
cout<<“Enter Second array:\n”;
for(j=0;j<6;j++)
{
cin>>b[j];
}
for(k=0;k<4;k++)
{
c[k]=a[k];
}
for(int x=0;x<6;x++)
{
c[k+x]=b[x];
}
cout<<“Merged Array is “;
for(int y=0;y<10;y++)
{
cout<<c[y]<<” “;
}
cout<<“\nReverse of merged array is “;
for(int z=9;z>=0;z–)
{
cout<<c[z]<<” “;
}

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