subject

Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain less than 20 integers. Ex: If the input is:

5 2 4 6 8 10
the output is:

all even
Ex: If the input is:

5 1 3 5 7 9
the output is:

all odd
Ex: If the input is:

5 1 2 3 4 5
the output is:

not even or odd
Your program must define and call the following two functions. IsArrayEven returns true if all integers in the array are even and false otherwise. IsArrayOdd returns true if all integers in the array are odd and false otherwise.

bool IsArrayEven(int inputVals[], int numVals)

bool IsArrayOdd(int inputVals[], int numVals)

#include

#include

/* Define your function here */

int main(void) {

/* Type your code here. Remember to include the bool library*/

return 0;

}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
question
Computers and Technology, 24.06.2019 21:40
Assume you need to test a function named inorder. the function inorder receives three int arguments and returns true if and only if the arguments are in non-decreasing order: that is, the second argument is not < the first and the third is not < the second. write the definition of driver function testinorder whose job it is to determine whether inorder is correct. so testinorder returns true if inorder is correct and returns false otherwise. for the purposes of this exercise, assume inorder is an expensive function call, so call it as few times as possible!
Answers: 1
question
Computers and Technology, 25.06.2019 06:20
In your pest busters game, how does player 2 move the ship 2 object? a pressing the w and s keys b. pressing the up arrow and down arrow keys c. moving the mouse from side to side d. moving the mouse up and down select the best answer from the choices provided
Answers: 1
You know the right answer?
Write a program that reads a list of integers, and outputs whether the list contains all even number...
Questions
question
Computers and Technology, 13.12.2020 21:20
question
Medicine, 13.12.2020 21:20
question
Mathematics, 13.12.2020 21:20
question
Social Studies, 13.12.2020 21:20
Questions on the website: 13722360