โ Back to Loops
Question 40
Factorial of N
Factorial of N
Read an integer N (assume N is at least 1), then use a loop to compute N! (the product of all integers from 1 to N). Print it in this exact format: Factorial of [N] is: [result] Example: if N is 6, print 'Factorial of 6 is: 720'.
Expected Output:
Factorial of 6 is: 720
Topics:
Loops
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.