Question: Write a C + + program with multiple functions that reads an array of type int and prints the number of negative numbers in an
Write a C program with multiple functions that reads an array of type int and prints the number of negative numbers in an array. The must have six entries in an array. The description of the functions are:
One function to collect a number from to inclusive, and return the number. The function returns only a number between and otherwise, it will keep asking the user to enter a valid number.
One function to collect up to numbers. Name this function numarray Each number must be between and inclusive, which is collected using the previous function. The numbers must be saved in an array.
One function to count and return the total number of negative numbers in an array. Hint: this function should go over the array created from the previous function.
One function to print all the six numbers saved in an array as
One function to prompt the result as
There are negative numbers!
The main function only has the following lines:int mainf
int arraysize n;
int numbers arraysizel;
numarray numbers arraysize; printnumnumbers arraysize;
n negnum numbers arraysize;
promptresultn ;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
