Question: 4 . 1 8 . 3 : Calculate a factorial. Write a program that lets a user enter N and that outputs N ! (

4.18.3: Calculate a factorial.
Write a program that lets a user enter N and that outputs N!(N factorial, meaning N*(N-1)*(N-2)*...*2*1). Hint:Use a loop variable i that counts from total-1 down to 1. Compare your output with some of these answers: 1:1,2:2,3:6,4:24,5:120,8:40320.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!