C Program to Copy all elements of an array into Another array

C Program to Copy all elements of an array into Another array

This page has a C Program to Copy the elements of an array into Another array. It is clear that, this C program will Copy all the elements of an array into Another array. For example:   If we enter 5 elements to an Array one by one as  35   78    43    12   46,  then the program will Copy all Array elements from the 1st array to 2nd Array as   35   78    43    12   46The below given C program will Copy all elements from one array into Another array.  Kindly check out the program to Copy the elements of an array into Another array. The Problem to Copy the elements of an array into Another array can be asked as,

1). C Program to Copy all elements of an array into Another array
2). C program to copy all elements of one array to another
3). C program to copy all elements of an array to another array
4). C program to copy the contents of one array into another
5). C Program to Copy the elements of one array into Another array

Program to Copy all elements from one array to Another 


    #include<stdio.h>
    int main() {
                  int array1[25], array2[25];
                  int i, j, n1;
                  printf("\nEnter no of elements to 1st array :");
                  scanf("%d", &n1);
                  printf("\n\n Enter the 1st Array elements one by one \n");
                  for (i = 1; i<=n1; i++)
                  scanf("%d", &array1[i]);
                  for (i = 1; i<=n1; i++)
                  array2[i] = array1[i];
                  printf("\n The Coppied Array elements in the 2nd Array : \n");
                  for (i = 1; i<=n1; i++)
                  printf("\n %d", array2[i]);
    return(0);
    }


Sample Output:                  

Enter no of elements to 1st array :5
Enter the 1st Array elements one by one
45 78 35 19 83
The Coppied Array elements in the 2nd Array :
45
78
35
19
83


Related Popular Posts:


*  Write a c program to check whether a given number is prime number or not?

 

*  Write a C program to find the prime numbers between 1 and 100

 

*  Write a C program to display the prime numbers between a range ?

 

*  Write a C program to find the prime numbers between a range using while loop?

 

*  Write a C program to find the sum of prime numbers between a range 

Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

Bookmark and Share