#### Write a program that inputs values into an array. It multiples the even values of elements with 5, odd values with 4 and adds the new values of array. Suppose a user inputs the following values in an array:

2, 3, 5, 6, 7

After multiplying the even values of elements with 5, odd values with 4, the new values of the array will be:

10, 12, 20, 30, 28

Sum of array: 100

**So let’s Write Code:**

**Code:**

**Write a program that inputs values into an array. It multiplies the even values of elements with 5, odd values with 4, and adds the new values of an array.**

```
#include<iostream>
using namespace std;
main()
{
int a[10], n, s = 0;
for(n = 0; n<=4; n++)
{
cout<<"Enter value in element "<<n<<" of array a ? ";
cin>>a[n];
}
```**// multiples the even values of elements with 5, odd values with 4 and adds the new values of array**
for(n = 0; n<=4; n++)
{
if(a[n]%2 == 0)
a[n] = a[n]*5;
else
a[n] = a[n]*4;
s = s + a[n];
cout<<a[n]<<endl;
}
cout<<"Sum of array : "<<s<<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/