Question: 1. Write a for loop sums all the numbers from 1 to 5. 2. Write a loop that calculates n! (n factorial, ex: 4! =
1. Write a for loop sums all the numbers from 1 to 5.
2. Write a loop that calculates n! (n factorial, ex: 4! = 1x2x3x4) where n is a value given to you by the user. You may assume n > 0.
3. Write a loop that sums all the numbers from m to n, where m and n are both user given values. You may assume m>n.
4. Write a loop that sums all the numbers from n down to 1, where n is a value given to you by the user. You may assume n > 1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
