Question: Problem 4 ( Odds and Evens Counter ) Write a program named oddeven counter.cpp that allows users to enter N integers from standard input. Calculates

Problem 4(
Odds and Evens Counter)
Write a program named
oddeven
counter.cpp
that allows users to enter
N
integers from
standard input. Calculates and displays number of evens and number of odds values.
Your program should report the message
Invalid value of N
if
N
0
/workspace/csc117/hw7
% g++-o out/evenodd_counter.out src/evenodd_counter.cpp
%./out/evenodd_counter.out
Enter the value of N: 10
Enter 10 integers: 35362742436354
There re 5 even numbers
There re 5 odd numbers
%./out/evenodd_counter.out
Enter the value of N: -10
Invalid value o

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!