Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- class Factorial
- {
- static void Main()
- {
- Console.Write("n = ");
- uint n = UInt32.Parse(Console.ReadLine());
- uint originalN = n;
- //decimal factorial = 1;
- BigInteger factorial = 1;
- do
- {
- factorial *= n;
- n--;
- }
- while (n > 1);
- Console.WriteLine("{0}! = {1}", originalN, factorial);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment