Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp17
- {
- class Program
- {
- static void Main(string[] args)
- {
- for (int i = 1; i <= 12; i++)
- {
- Console.WriteLine(i + " ... " + factorial(i));
- }
- Console.ReadLine();
- }
- static int factorial(int number)
- {
- int result = number;
- for (int i = number - 1; i >= 1; i--)
- {
- result = result * i;
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement