-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpyarray.c
More file actions
34 lines (31 loc) · 886 Bytes
/
Copy pathcpyarray.c
File metadata and controls
34 lines (31 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*-------------------------------------------------------------------------------------------------------------------------------
cpyarray.c
Program to copy the contents of one array to another array
DIVYA RAJ K
22-09-2018
---------------------------------------------------------------------------------------------------------------------------------*/
#include<stdio.h>
#include<math.h>
main()
{
int X[30],Y[30],N,i,j;
system("clear");
printf("Program to copy the contents of one array to another array\n\n");
printf("Enter the number of elements: ");
scanf("%d",&N);
printf("Enter %d numbers:\n",N);
for(i=1;i<=N;i++){
scanf("%d",&X[i]);
}
for(i=1;i<=N;i++){
Y[i]=X[i];
}
printf("\nThe contents of first array are:\n");
for(i=1;i<=N;i++){
printf("%d\t",X[i]);
}
printf("\nThe contents of second array are:\n");
for(i=1;i<=N;i++){
printf("%d\t",Y[i]);
}
}