|Write a program to find the factorial of a given n...|General Coding Problems

fn factorial(n: u32) -> u64

Easy

Write a program to find the factorial of a given number.

fn factorial(n: u32) -> u64

Asked in

cognizant

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