FACTORIAL PROGRAM IN VB.NET
Private Sub Command1_Click(Byval sender as system.object,byval e as system.eventargs)
Dim j, i as Integer
i = CInt(Text1.Text)
Label2.Caption = facts(i)
End Sub
Private Function facts(i)
F = 1
For j = 1 To i
F = F * j
facts = F
Next j
End Function
Private Sub Command1_Click(Byval sender as system.object,byval e as system.eventargs)
Dim j, i as Integer
i = CInt(Text1.Text)
Label2.Caption = facts(i)
End Sub
Private Function facts(i)
F = 1
For j = 1 To i
F = F * j
facts = F
Next j
End Function
0 comments:
Post a Comment