C program to merge two array

in #steemit7 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.19
TRX 0.15
JST 0.029
BTC 63914.63
ETH 2664.93
USDT 1.00
SBD 2.77