C program to merge two array

in #steemit6 years ago (edited)

Array is the collection of same type of data elements. In this blog we will learn to merge two array of same size named as a & b in a single array c.

          

Program :


#include< stdio.h>

#include<conio.h>

int main()

{

int a[50],b[50],c[100],i,n,j,m;

printf("Enter the value of n and m :");

scanf("%d%d",&m,&n);

printf("Enter the value of array :\n");

for(i=0;i<n;i++)

{

scanf("%d",&a[i]);

}

for(i=0;i<m;i++)

{

scanf("%d",&m);

}

j=0;

for(i=-;i<n;i++)

{

c[j]=a[i];

printf("%d",a[i]);

j++;

}

for(i=0;i<m;i++)

{

c[j]=b[i];

printf("%d",b[i]);

j++;

}

retrun 0;

}


Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 63897.91
ETH 3131.06
USDT 1.00
SBD 3.87