Question: Write a function named count that produces the number (number) of positive, negative and zero values in the array according to the integer array and

Write a function named count that produces the number (number) of positive, negative and zero values in the array according to the integer array and the number of elements sent to it. Your function should match the main function below. Do not use global variables and do not add anything to the main function except for the places left blank (dotted places). (In the function, a pointer must meet the array and a global variable should not be used. Access to array elements must be done according to offset notation.
SAMPLE PROGRAM:
................................. / * Prototype * /
int main ()
{
int array [] = {- 1, 2, 4, 6, 0, -2, 0};
int nSay, pSay, sPay;
say (........................................);
printf (Negative Count =% d \ n
Number of Positives =% d \ n
Number Zero =% d , nSay, pSay, sSay);
return 0;
}
OUTPUT:
Number of Negatives = 2
Number of Positives = 3
Number of Zero = 2

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 Databases Questions!