A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Write a program to copy elements of one array to another arrays in C programming

Program:


#include<stdio.h>
#include<conio.h>
int main()
{
   int a[5],b[10],i,j;
   printf("Enter five Values in an array: ");
   for(i=0;i<=4;i++)
   {
       scanf("%d",&a[i]);
   }
   printf("\nCoping elements of a[] to b[] array: ");
   for(i=0;i<=4;i++)
   {
       b[i]=a[i];
   }
   printf("\nElements of b[] array are= ");
   for(i=0;i<=4;i++)
   printf("\n%d",b[i]);
   getch();
}

Output:


LEARN TUTORIALS

.

.