Form görüntüsü
"Faktöriyel" butonuna basıyoruz ve içerisine şu kodları yazıyoruz.
-------------------------------------------------
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sayi, z As Integer
sayi = 1
If TextBox1.Text = 0 Then 'eğer girilen sayı 0 ise
TextBox2.Text = 1 'Faktöriyeli yazan yerde 1 görüntüle
Else
For z = 1 To TextBox1.Text
sayi = sayi * z
Next
End If
TextBox2.Text = sayi
End Sub
End Class
---------------------------------------------

Hiç yorum yok:
Yorum Gönder