Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 5.
- * კონსოლიდან შეიტანეთ მთელი რიცხვი N. ცნობილია, რომ N > 0.
- * იპოვეთ N რიცხვის ფაქტორიალი, რომელიც გამოითვლება ფორმულით : N!=1*2*3*....* N.
- * გამოიტანეთ პასუხი კონსოლში.
- */
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N, Sum = 1;
- N = int.Parse(Console.ReadLine());
- for (int i = 1; i <= N; i++)
- {
- Sum *= i;
- }
- Console.WriteLine(Sum.ToString());
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment