Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function Faktorial(ByVal nilai As Byte) As Double
- Dim hasil As Double = 1
- For i = 2 To nilai
- hasil = hasil * i
- Next
- Faktorial = hasil
- End Function
- Public Function Kombinasi(ByVal a As Long, ByVal b As Integer) As Double
- Kombinasi = Faktorial(a) / (Faktorial(a - b) * b)
- End Function
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim c As Double
- c = Kombinasi(TextBox1.Text, TextBox2.Text)
- Label1.Text = c
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement