ForLoop Program
Description
This program uses several for loops to print a sequence of numbers and calculates the sum and average of these numbers.Associated Concepts:
for loop
Algorithm:
Input a positive integer n
Use a for loop to print every number from n to 50,
and calculate the sum and average of these numbers
Use another for loop to print every number from 50 to n,
and calculate the sum and average of these numbers
Use another for loop print every even number from n to 50,
and calculate the sum and average of these numbers
Use a for loop to print every number from n to 50,
and calculate the sum and average of these numbers
Use another for loop to print every number from 50 to n,
and calculate the sum and average of these numbers
Use another for loop print every even number from n to 50,
and calculate the sum and average of these numbers