Copy all the data in another array and print both data of array in 1D Array.
#include<stdio.h>
#include<conio.h>
void main( )
{
int arr1[10], arr2[10], i ;
clrscr( );
for( i=0; i<10; i=i+1 )
{
printf("Enter data ");
scanf("%d", & arr1[i]);
}
for( i=0; i<10; i=i+1 )
{
arr2[i]=arr1[i];
}
for ( i=0; i<10; i=i+1 )
{
printf("%d-%d\n",arr1[i],arr2[i]);
}
getch( );
}
#include<stdio.h>
#include<conio.h>
void main( )
{
int arr1[10], arr2[10], i ;
clrscr( );
for( i=0; i<10; i=i+1 )
{
printf("Enter data ");
scanf("%d", & arr1[i]);
}
for( i=0; i<10; i=i+1 )
{
arr2[i]=arr1[i];
}
for ( i=0; i<10; i=i+1 )
{
printf("%d-%d\n",arr1[i],arr2[i]);
}
getch( );
}
0 Comments