You are on page 1of 1

Store Three Arrays in One

============================================
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int
array1[10]={1,2,3,4,5,6,7,8,9,0},array2[10]={1,2,3,4,5,6,7,8,9,0},
array3[10]={1,2,3,4,5,6,7,8,9,0},array4[30];
int j=0;
for (int i=0;i<30;i++)
{
if (j==10)
j=0;

if (i<10)
array4[i]=array1[j];
if (i>=10&&i<20)
array4[i]=array2[j];
if (i>=20&&i<30)
array4[i]=array3[j];

j++;
}
cout<<endl;
for (int k=0;k<30;k++)
{
cout<<array4[k]<<" ";
}

getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006