Question

Given Arr[10] = {7, 9, 13, 15, 16, 10, 12, 5, 20, 27} Write a program...

Given Arr[10] = {7, 9, 13, 15, 16, 10, 12, 5, 20, 27}

Write a program to count number of EVEN and ODD items. Do a screen output of your result.

for c++ please

Homework Answers

Answer #1

Answer: main.cpp

#include <iostream>

using namespace std;

int main()
{
   int Arr[]={7,9,13,15,16,10,12,5,20,27};
   int evenCount=0, oddCount=0;
   for(int i=0;i<10;i++){
       if(Arr[i]%2==0)
          evenCount++;
       else 
          oddCount++;
   }
   cout<<"Number of even items :"<<evenCount;
   cout<<"\nNumber of odd items :"<<oddCount;
   
   return 0;
}

Output:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Given Arr[10] = {7, 9, 13, 15, 16, 10, 12, 5, 20, 27} Write a program...
Given Arr[10] = {7, 9, 13, 15, 16, 10, 12, 5, 20, 27} Write a program to construct array ODD[] and EVEN[] from Arr[10] as you realize ODD[] consists of odd number and EVEN[] consists of even number. for c++
Given ID X Y A 10 15 B 4 5 C 13 16 D 7 9...
Given ID X Y A 10 15 B 4 5 C 13 16 D 7 9 E 13 4 F 1 5 What is the variation in Y that can be explained by X? please explain A) 50.7 B) 22.7 C) 36.3 D) 105.7 E) 91.3
y 10 11 15 15 20 24 27 32 x1 2 5 5 9 7 11...
y 10 11 15 15 20 24 27 32 x1 2 5 5 9 7 11 16 22 x2 16 10 13 10 2 8 7 4 a) Construct a​ 95% confidence interval for the dependent variable when x1=7 and x2=11. The​ 95% confidence interval is from a lower limit of ___ to an upper limit of ___. b) Construct a​ 95% prediction interval for the dependent variable when x1=7 and x2=11. The​ 95% prediction interval is from a lower...
13, 16, 7, 8, 10, 19, 15, 16, 13, 15 ,8 ,5 ,12, 17, 10, 0,...
13, 16, 7, 8, 10, 19, 15, 16, 13, 15 ,8 ,5 ,12, 17, 10, 0, 3, 14, 12, 2 The data represent the​ time, in​ minutes, spent reading a political blog in a day. Construct a frequency distribution using 5 classes. In the​ table, include the​ midpoints, relative​ frequencies, and cumulative frequencies. Which class has the greatest frequency and which has the least​ frequency?
Cork price: 16 10 15 10 17 11 14 13 11 14 11 16 18 16...
Cork price: 16 10 15 10 17 11 14 13 11 14 11 16 18 16 10 17 14 14 16 7 10 12 19 15 16 14 9 12 21 13 10 16 12 16 13 17 17 13 14 18 11 12 15 16 13 18 16 17 12 12 14 9 11 14 19 13 11 17 11 13 15 14 18 18 18 12 10 11 13 14 11 14 18 13 13 19 17 14...
Cork price: 16 10 15 10 17 11 14 13 11 14 11 16 18 16...
Cork price: 16 10 15 10 17 11 14 13 11 14 11 16 18 16 10 17 14 14 16 7 10 12 19 15 16 14 9 12 21 13 10 16 12 16 13 17 17 13 14 18 11 12 15 16 13 18 16 17 12 12 14 9 11 14 19 13 11 17 11 13 15 14 18 18 18 12 10 11 13 14 11 14 18 13 13 19 17 14...
Dep Delay Arr Delay q1 -13 -9 q3 1 3 IQR 14 12 stdev 9.211846 9.660933...
Dep Delay Arr Delay q1 -13 -9 q3 1 3 IQR 14 12 stdev 9.211846 9.660933 negative 291 zero 39 positive 170 total (should be 500) 500 all data is for arrival data. please help me explain these can someone help me answer these questions and tell me how to put them in excel.thanx in advance 1.    Define a random variable (X) so that your chosen data set represents values of X. 2.    Is your chosen random variable discrete or...
IN JAVA Write a program that, given an integer, inserts a '*' between adjacent digits that...
IN JAVA Write a program that, given an integer, inserts a '*' between adjacent digits that are both even and a '-' between adjacent digits that are both odd. Zero should not be considered even or odd. EX: 12467930 Expected Output 12*4*67-9-30
Lessons Frequency 10-12 5 13-15 9 16-18 12 19-21 4 22-24 10 The mean for that...
Lessons Frequency 10-12 5 13-15 9 16-18 12 19-21 4 22-24 10 The mean for that distribution is: - 19.11 - 18.22 - 17.38 - 16.15 The mode of this distribution is: -23 -15 -17 -12
A = [1 2 3 4 5 6 7 8 9 10 11 12 13 14...
A = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] In MATLAB. Use a fully vectorized code (ie. no loops) to determine when the numbers have increased to at least 15 in the above array. Report answer to command window.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT