VB .NET
Slip4
Q.1) Write a Vb.net program to accept a number from an user through InputBox and display its multiplication table into the ListBox. [Marks 20]
Solution
Public Class Slip4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n, i As Integer
n = InputBox("Enter no to Multiplied")
For i = 1 To 10
ListBox1.Items.Add(n & "*" & i & "=" & n * i)
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
End Sub
End Class
Output
Tags:
VB .NET
