AccessTr.neT
Faktoriyel Hesaplama - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Visual Basic 6 (https://accesstr.net/forum-visual-basic-6.html)
+--- Forum: Visual Basic 6 Örnekleri ve Uygulamaları (https://accesstr.net/forum-visual-basic-6-ornekleri-ve-uygulamalari.html)
+--- Konu Başlığı: Faktoriyel Hesaplama (/konu-faktoriyel-hesaplama.html)



Faktoriyel Hesaplama - harun_061 - 22/04/2009

işinize yarayabilir faktorıyel hesaplama programı


Cvp: Faktoriyel Hesaplama - Nika - 22/04/2009

Tesekkurler Sn.Harun_061,
Bir de progrsami gorebilseydik.

Sevgi ve Saygilar


Cvp: Faktoriyel Hesaplama - Seruz - 22/04/2009

Sanırım dosyayı eklemeyi unutmuşsunuz sn. harun_061


Cvp: Faktoriyel Hesaplama - Krizantem - 22/04/2009

Kod:
Private Function Faktoriyel(i As Integer) As Long
Dim t As Integer
Dim sn As Long
Dim j As Integer
If i = 0 Or i = 1 Then
  Faktoriyel = 1
  Exit Function
End If
t = 1
If i < 0 Then
  i = Abs(i)
  If (i Mod 2) = 0 Then t = 1 Else t = -1
End If
sn = 1
For j = 1 To i
  sn = sn * j
Next
Faktoriyel = sn * t
End Function

Herşeyi devletten beklememek lazım Img-grin