Here is what i wrote

Code:

#include <stdio.h>
void sums(int Input[], int elements, int *numOfP, int *numOfN, int *PSum, int *NSum, int *Paverage, int *Naverage );
int main()
{
int Input[10];
int PSum = 0, NSum = 0, userInput; //positive and negative sum
int numOfP = 0, numOfN = 0; //number of postive and negatives
int i;
int Paverage ;
int Naverage ;
printf ("Username CS110 Program7\n\n");
printf("Input Read:\n");
for(i = 0; i < 10; i++){
scanf( " %lf", &userInput);
if(userInput == 0){
break;
}
Input[i] = userInput;
}
sums(Input, i, &numOfP, &numOfN, &PSum, &NSum, &Paverage, &Naverage );
Paverage= (PSum / numOfP) +.5;
Naverage= (NSum / numOfN) +.5;
printf("Statistics:\n");
printf("Desc Number Total: Average: \n");
printf("Positive: %8,4f %8.4f %8.4f\n", numOfP, PSum, Paverage );
printf("Negative: %8.4f %8.4f %8.4f", numOfN, NSum, Naverage );
return 0;
}
void sums(double Input[], int elements, int *numOfP, int *numOfN, int *PSum, int *NSumint, *Paverage, int *Naverage)
{
int i;
for(i = 0; i < elements; i++){
if(Input[i] > 0){
*numOfP += 1;
*PSum += Input[i];
}
else{
*numOfN += 1;
*NSum += Input[i];
}
}
}