Count positive and negative number and compute the average. the program will have the user input an unspecified number of integers.
determine how many are positive and negative.
compute the total and average. use a while loop.
output as follows:
enter an integer, the input ends if it is 0: 1 2 -1 3 0
the number of positives: 3
the number of negatives: 1
the total is 5.0
the average is 1.25

Solved
Show answers

Ask an AI advisor a question