VB (Program Menghitung Permutasi)

Public Class Form1

Dim P As Integer

Sub Bersih()
TxtN.Text = " "
TxtR.Text = " "
LblHasil.Text = " "
TxtN.Focus()

End Sub
Function faktorial(ByVal A As Integer) As Long
Dim f As Long
Dim i As Integer
f = 1
For i = 2 To A
f = f * i

Next
faktorial = f

End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call Bersih()

End Sub

Private Sub BtnKosong_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKosong.Click
Call Bersih()

End Sub

Private Sub BtnHitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHitung.Click
P = faktorial(TxtN.Text) / faktorial(TxtR.Text)
LblHasil.Text = P
End Sub

Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKeluar.Click
Me.Close()

End Sub
End Class

Category: 2 komentar

2 komentar:

Anonim mengatakan...

TATOMBIE - TITanium-ART
TATOMBIE damascus titanium - titanium watch band TITanium-ART: A world full of amazing worlds from the creators of TOTO. TOTO's TOTO is titanium money clip an international paintball machine titanium vs stainless steel designed to give an authentic micro titanium trim

senar mengatakan...

hop over to this web-site dildo,realistic sex dolls,vibrators,dildo,real dolls,realistic dildo,male sex doll,dog dildo,sex toys this content

Posting Komentar