Write a simple program based on the use of For and NN bile Loops to calculate the
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a simple program based on the use of For and NN bile 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 Nice: once using for loop and once using while loop. If thc user will enter zero or a negative number, the program should display a message (Not valid number)
For example if the user wants to find the average of 3 numbers, the output should be: lion many numbers do you want to find the average for?
3
Enter the numbers
2
3
1
the average is 2
Related Book For
Business Forecasting with ForecastX
ISBN: 978-0073373645
6th edition
Authors: Holton wilson, barry keating, john solutions inc
Posted Date: