Question: Write a program that reads a collections of positive and negative integers and multiplies only the positive integers. Loop exit should occur when three consecutive

Write a program that reads a collections of positive and negative integers and multiplies only the positive integers. Loop exit should occur when three consecutive negative values are read.

Example output requirements: Enter positive #: 2 Enter positive #: 4 Enter positive #: 8 Enter positive #: -1 Enter positive #: 2 Enter positive #: -1 Enter positive #: -2 Enter positive #: -3 Product of positive integers is 128

2.cpp Write a program to find the largest, smallest, and average values in a collection of n numbers where the value of n will be the first data item read.

Example output requirements: Enter n: 4 #1: 2 #2: 3 #3: 4 #4: 1 Smallest: 1 Largest: 4 Average: 2.5

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!