C++20 sections · 1024 units
Open in Course

Challenge: Factorial

Multiplication loop

Factorial is a classic loop problem! Your task: Read a positive integer N and calculate N! (N factorial). Remember: 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120, and 0!=10! = 1.