Factorial
Lesson 11 of 20 in Coddy's Beginner Challenges - Practice Basic Concepts course.
Challenge
EasyWrite a function named fact that gets num and returns the factorial of num.
Examples,
- Factorial of 6 (6!) -> 1 * 2 * 3 * 4 * 5 * 6 = 720
- Factorial of 3 (3!) -> 1 * 2 * 3 = 6
Try it yourself
int fact(int num) {
// Write code here
}