#include<stdio.h>
#include<conio.h>
void input(int[],int);
void display(int[],int);
void merge(int[],int[],int[],int,int);
void main()
{
int arr1[10],arr2[10],arr3[10],m,n;
clrscr();
printf("\nEnter the size of first array=");
scanf("%d",&m);
printf("\nEnter the size of second array=");
scanf("%d",&n);
printf("\nEnter element in first array");
input(arr1,m);
printf("\nEnter element in second array");
input(arr2,n);
printf("\nFirst array");
display(arr1,m);
printf("\nSecond array");
display(arr2,n);
printf("\nAfter merging the array is=");
merge(arr1,arr2,arr3,m,n);
display(arr3,m+n);
getch();
}
void input(int arr[],int n)
{
int i;
for(i=0;i<n;i++)
{
printf("\nEnter element=");
scanf("%d",&arr[i]);
}
}
void display(int arr[],int n)
{
int i;
printf("\nThe array is=");
for(i=0;i<n;i++)
{
printf("\n%d",arr[i]);
}
}
void merge(int arr1[],int arr2[],int arr3[],int m,int n)
{
int i,j=0;
for(i=0;i<m;i++)
{
arr3[j]=arr1[i];
j++;
}
for(i=0;i<n;i++)
{
arr3[j]=arr2[i];
j++;
}
}


WE ALSO PROVIDE THE ON DEMAND PROJECTS EITHER DOMESTIC, COLLEGE PROJECTS AND COMMERCIAL PROJECTS TOO. YOU WILL GET YOUR PROJECT COMPLETELY ACCORDING TO YOUR REQUIREMENTS..
Contacts us at:- knowledgeforyou2022@gmail.com

Leave a Reply

Your email address will not be published.