Klavyeden girilen sayının faktöriyelini ekrana yazan program — C# Console
[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;//www.gorselprogramlama.com
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
int sayi, faktoriyel = 1;//www.gorselprogramlama.com
Console.Write("Sayı giriniz >>>");
sayi = Convert.ToInt32(Console.ReadLine());
for (int i = sayi ; i >0; i–)
{
faktoriyel = faktoriyel * i;//www.gorselprogramlama.com
}
Console.Write("Sonuç ="+faktoriyel);
Console.ReadKey();
}
}//www.gorselprogramlama.com
}
[/code]