|Write a program to calculate the factorial of a nu...|General Coding Problems

fn factorial(n: u32) -> u64

Easy

Write a program to calculate the factorial of a number N.

fn factorial(n: u32) -> u64

Asked in

wipro

Examples

Example 1:
Input: 5
Output: 120
Example 2:
Input: 0
Output: 1
Submit Result

Click Run to test sample cases, or Submit to evaluate all cases