Question: Write a program that reads a list of integers in one vector, and outputs whether the integers are all even numbers, odd numbers, or neither.

Write a program that reads a list of integers in one vector, and outputs whether the integers are all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers that follow.
Ex: If the input is:
5246810
the output is:
all even
Ex: If the input is:
51-35-79
the output is:
all odd
Ex: If the input is:
512345
the output is:
not even or odd

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!