Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num;
- Console.Write("Enter a number: ");
- num = int.Parse(Console.ReadLine());
- Console.WriteLine("You enteres '{0}'", num);
- int fact = 1;
- for (int i = 1; i <= num; i++)
- {
- fact = fact * i;
- }
- Console.WriteLine("Factorial is {0}", fact);
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment