Recursive yapı ile faktöriyel hesabı yapan alternatif bir C# kodudur.
public double FaktoriyelHesapla(int sayi)
{
double sonuc;
if (sayi == 0 || sayi == 1) return 1;
{
sonuc = FaktoriyelHesapla(sayi - 1) * (sayi);
return sonuc;
}
}