We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
#include<iostream>
using namespace std;
int main () { int n, a[4]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } int m, b[2]; cin>>m; for(int i=1;i<=m;i++){ cin>>b[i]; } int c[6]; int k=0; int i=1,j=1; while (i<=n && j<=m){ if (a[i]<b[j]){ k++; c[k]=a[i]; i++; } else{ k++; c[k]=b[j]; j++; } } while (i<=n){ k++; c[k]=a[i]; i++; } while (j<=m){ k++; c[k]=b[j]; j++; } cout<<"In mod normal: "; for (i=1;i<=k;i++) { cout<<c[i]<<" ";