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 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...
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
Data Set A: 11, 12, 13 Data Set B: 9, 10, 11, 12, 13, 14, 15...
Data Set A: 11, 12, 13 Data Set B: 9, 10, 11, 12, 13, 14, 15 Data Set C: 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 Find the mean, sample standard deviation–treating the data as a sample, and the population standard deviation–treating the data as a population.
Let U = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, A = {5,...
Let U = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, A = {5, 7, 9, 11, 13}, B = {6, 8, 10, 12, 14}, and C = {5, 6, 8, 9, 12, 13}. List the elements of each set. (Enter your answers using roster notation. Enter EMPTY or ∅ for the empty set.) (a)    Ac ∩ (B ∩ C c) (b)    (A ∪ Bc) ∪ (B ∩ C c) (c)    (A ∪ B)c ∩ C c
Indices   DUR   DUR (OLD) 1   6   11 2   13   14 3   11   14 4   7   10...
Indices   DUR   DUR (OLD) 1   6   11 2   13   14 3   11   14 4   7   10 5   9   9 6   7   10 7   8   11 8   5   8 9   7   6 10   7   10 11   7   13 12   3   5 13   10   13 14   3   15 15   4   12 16   9   7 17   9   8 18   10   13 19   6   10 20   8   14 21   10   14 22   8   18 23   2   10 24   4   11 25   7   16 26  ...