Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Factorial
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int fact = 1;
- do
- {
- fact = fact * n;
- n--;
- }
- while (n > 1);
- Console.WriteLine(fact);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement