Question: Extend the program below so that it also calculates the average of all numbers between 18 and 30. Use a separate loop. Try as well

Extend the program below so that it also calculates the average of all numbers between 18 and 30. Use a separate loop. Try as well to: 1) Use functions 2) make the program flexible enough to compute the average of values within any other range.
Code: #include  using namespace std; void readData(int, *data, int sz){ } int main(){ //set size of array and create it int sz = 0; int arr[sz]; cout<<"enter num data: "<>sz; int *data = new int[sz]; //int data[5]; cout<<"Data is "<>data[i]; } //loop 2:calculate the average int sum = 0; for (int i=0; i                                            

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!