Question: c++ compiler + flow chart please Write a simple program based on the use of For Loop to calculate the average of a set of
Write a simple program based on the use of For Loop to calculate the average of a set of numbers. The program should ask the user to enter how many numbers they want to find the average for. If the user will enter a zero or a negative number for that, then the program should display a message (Not valid number). If the user enters a positive number, then the program will ask the user to enter all the numbers that he/she wants to find the average for and then the program will calculate the average. Finally, the average value will be printed. For example if the user wants to find the average of 3 numbers, the output should be: How many numbers do you want to find the average for? 3 Enter the numbers 2 3 1 The average is 2 Task 2: Repeat task 1 using WHILE loop instead of FOR loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
