← 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= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.