Question: C++ Task: Write a simple program based on the use of For and While Loops to calculate the average of numbers. The program should ask
C++
Task: Write a simple program based on the use of For and While Loops to calculate the average of numbers. The program should ask the user to enter how many numbers they want to find the average for and to calculate the average depending on that. Write the program twice: once using for loop and once using while loop. If the user will enter zero or a negative number, the program should display a message (Not valid number) For example if the ser wants to find the average of 3 numbers, the output should be: How many numbers do you want to find the average for? Enter the numbers 3 The average is 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
