Sorting and Merging

Description:           This program first sort the two given arrays and then merge them in ascending order.
Primary Inputs:    Two arrays of size 5
Primary Output:    Single array containing the elements of both the given arrays arranged in ascending order
Platform Used:      Turbo C++ version 3.0, Borland International Inc.

/*program to sort and merge two given arrays*/


void main()
int a[5],b[5],c[10],i,j,k,p;

printf("enter array 1st#");
for(i=0;i<5;i++) scanf("%d",&a[i]); printf("enter array 2nd#"); for(i=0;i<5;i++) scanf("%d",&b[i]); for(i=0;i<5;i++) { for(j=0;j<5;j++) { if(a[i]


Rate this post

Leave a Reply