Advertisement
adcorp

VIRUS! [TEST]

Dec 3rd, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<stdio.h>
  4. int merge(int A[],int B[]);
  5. void main()
  6. {
  7. clrscr();
  8. int a[10],b[10],c[20];
  9. cout<<"enter values:   ";
  10. for(int i=0;i<10;i++)
  11.    { cin>>a[i];
  12.     }
  13. for(int k=0;k<10;k++)
  14.    cin>>b[k];
  15.  
  16. cout<<"merged arrays, in ascending order are: "<<merge(a,b);
  17. getch();
  18. }
  19. int merge(int a[10], int b[10])
  20. {
  21.    int c[20];
  22.    for( int x=0;x<10;x++)
  23.      c[x]=a[x];
  24.    for( int q=0;q<10;q++)
  25.      c[q+10]=b[q];
  26. return c[20];
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement