Monday, 4 April 2016

Lab 3:Write a Visual Basic Program to Find Factorial Of a number

Private Sub Command1_Click()
Dim n As Integer
Dim i As Integer
Dim fact As Double
n = Val(Text1.Text)
fact = 1
For i = 1 To n
fact = fact * i
Next i
Print "  The factorial of a number is"; fact
End Sub

No comments:

Post a Comment