-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ4.cpp
More file actions
45 lines (39 loc) · 697 Bytes
/
Copy pathQ4.cpp
File metadata and controls
45 lines (39 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{
int a[5];
int b[5];
int c[10];
int i;
cout<<"Enter Array of a"<<endl;//
for(int i=0;i<5;i++)
cin>>a[i];
cout<<"Enter Array of b"<<endl;
for(int i=0;i<5;i++)
cin>>b[i];
int count=0;
for(int i=0;i<5;i++)
{
if (count<10)
{
c[count]=a[i];
count=count+2;
}
}
int count2=1;
for(int j=0;j<5;j++)
{
if (count2<10)
{
c[count2]=b[j];
count2=count2+2;
}
}
for(int i=0;i<10;i++)
// cout<<"Array1"<<a[i];
// cout<<"Array2"<<b[j];
cout<<c[i]<<endl;
}