/* This is a program in C language to copy all elements of a array into
another array in same order */
#include<stdio.h>
#include<conio.h>
void main()
{
int array1[10],array2[10],i;
clrscr();
// To enter elements of array1
printf("Enter 10 elements for array1 \n");
for(i=0;i<10;i++)
{
scanf("%d",&array1[i]);
}
// copying the elements of array1 into array2
for(i=0;i<10;i++)
{
array2[i]=array1[i];
}
// Displaying the elements of array2
printf("The elements of arrray2 are : \n");
for(i=0;i<10;i++)
{
printf("%d \n",array2[i]);
}
getch();
}
/*
Developed by
Avichal Vishnoi
on 2020.06.01 at 12:00 PM
*/
another array in same order */
#include<stdio.h>
#include<conio.h>
void main()
{
int array1[10],array2[10],i;
clrscr();
// To enter elements of array1
printf("Enter 10 elements for array1 \n");
for(i=0;i<10;i++)
{
scanf("%d",&array1[i]);
}
// copying the elements of array1 into array2
for(i=0;i<10;i++)
{
array2[i]=array1[i];
}
// Displaying the elements of array2
printf("The elements of arrray2 are : \n");
for(i=0;i<10;i++)
{
printf("%d \n",array2[i]);
}
getch();
}
/*
Developed by
Avichal Vishnoi
on 2020.06.01 at 12:00 PM
*/
Comments
Post a Comment