Practical-No 08
Practical-No 08
Practical No 08
VIII. Resources required (Additional)
If any web resources required.
For i = 1 To num
fact *= i
Next
Factorial = fact
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim fact As Long
fact = Factorial(TextBox1.Text)
MessageBox.Show("Factorial of " & TextBox1.Text &
" is " & fact, "Factorial", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Sub
End Class
XIV. Exercise
1. Write a program to perform the arithmetic operations using controls Label, Button
and TextBox.
Public Class Form1
Dim n As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
n = Val(TextBox1.Text) + Val(TextBox2.Text)
TextBox3.Text = n
End Sub
2. Write a program to change the background color of the form when user clicks on
different buttons.
Output: