#### Write a program that uses three one-dimensional arrays and inputs 20 values in 1st array and differentiates even and odd values. It stores even values in 2nd array and odd values into 3rd array. The program should display the values of 2nd and 3rd array into two columns with heading EVEN and ODD.

**So let’s Write Code:**

**Code:**

**Write a program that uses three one-dimensional arrays and inputs 20 values in 1st array and differentiates even and odd values.**

```
#include<iostream>
using namespace std;
main()
{
int a[20],b[20], c[20], odd = 0, even = 0, n;
for(n = 0; n<=19; n++)
{
cout<<"Enter value in element "<<n<<" of array a ? ";
cin>>a[n];
if(a[n]%2 == 0)
b[even++] = a[n];
else
c[odd++] = a[n];
}
cout<<"\n\nValues of 2nd and 3rd arrays "<<endl;
cout<<"EVEN \t ODD"<<endl;
for(n = 0; n<even || n<odd; n++)
{
if(n<even)
cout<<b[n]<<"\t";
else
cout<<" \t";
if(n<odd)
cout<<c[n]<<" \t";
else
cout<<" \t";
cout<<endl;
}
}
```

**Hope You will learn Something. Happy Coding.**

###### Visit my YouTube Channel as WellðŸ˜‡ https://www.youtube.com/watch?v=JuIHQ9cLSEw&list=PLbIhkHxfUIItTdcyCb34uRIrPJbXBndIl&index=4

**Click on the below Links for more Programming Exercises: **

**Conditional Structure Exercises: **ðŸ‘‰https://myustaadg.com/category/programming-exercises/conditional-structures-exercises/

**Array Exercises: ðŸ‘‰**https://myustaadg.com/category/programming-exercises/arrays-exercises/