Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- #include<stdio.h>
- int merge(int A[],int B[]);
- void main()
- {
- clrscr();
- int a[10],b[10],c[20];
- cout<<"enter values: ";
- for(int i=0;i<10;i++)
- { cin>>a[i];
- }
- for(int k=0;k<10;k++)
- cin>>b[k];
- cout<<"merged arrays, in ascending order are: "<<merge(a,b);
- getch();
- }
- int merge(int a[10], int b[10])
- {
- int c[20];
- for( int x=0;x<10;x++)
- c[x]=a[x];
- for( int q=0;q<10;q++)
- c[q+10]=b[q];
- return c[20];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement