Write a program that reads an unspecified number of integers, determines how many positive and

negative values have been read, and computes the total and average of the input values(not

counting zeros). Your program ends with the input 0. Display the average as a double. Here is a

sample run:

Enter an integer, the input ends if it is 0: 1 2 -1 3 0

The number of positives is 3.

The number of negatives is 1.

The total is 5.

The average is 1.25.

This is the program which I wrote:

#include<iostream> using namespace std; int main (){ int x; int numofpos=0; int numofnegs=0; int total=0; int sum=0; int average=0; cout<< "Please enter a number:"; cin>>x; while (x!=0){ if (x >0){ numofpos=numofpos++; } if (x <0){ numofnegs=numofnegs++; } sum +=x; } cout<< "The number of positive numbers is"<< numofpos<<endl; cout<< "The number of negative numbers is"<< numofnegs<<endl; cout<< "The total number is"<<sum<<endl; cout<< "The average is"<<(sum)/(numofpos+numofnegs)<<endl; return 0; }

When I run the program, I am asked to only input the numbers, but I do not get the output which I asked for. Please keep it basic!