19. Write program in VB to find factorial of a number using ‘msgbox’.


Private Sub cmdClear_Click()
Text1.Text = “”
Text1.SetFocus
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdFact_Click()
Dim n, f, i As Integer
f = 1
n = Val(Text1.Text)
For i = 1 To n
f = f * i
Next
MsgBox “Factorial is :” & f, vbInformation, “Factorail”
End Sub

Private Sub Form_Activate()
Text1.SetFocus
End Sub

2 thoughts on “19. Write program in VB to find factorial of a number using ‘msgbox’.

  1. mnbhj says:

    galat hai be tera

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s