PROGRAM TO COPY AN ARRAY INTO ANOTHER ARRAY

/*PROGRAM TO COPY AN ARRAY INTO ANOTHER ARRAY*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,a[5],b[5];
clrscr();
printf(“Enter any five elements in the array:\n”);
for(i=0;i<5;i++)
scanf(“%d”,&a[i]);
printf(“Elements of original array are:\n” );
for(i=0;i<5;i++)
{
printf(“%d\t”,a[i]);
b[i]=a[i];
}
printf(“\nElements of copied array are:\n”);
for(i=0;i<5;i++)
printf(“%d\t”,b[i]);
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *