Question: Write a program to read a sequence of integers and print out how many of the integers are greater than 0 and print how many

Write a program to read a sequence of integers and print out how many of the integers are greater than 0 and print how many are less than 0.

The sequence is terminated by a 0.

Example:

If the input is: 7 15 -3 2 -9 0

Output should say: there are 3 greaterr than 0 and 2 less than 0

And if the input is 0

Output should say: There are 0 greater than 0 and 0 less than 0

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!