Write a Vb.net program to accept a number from an user through InputBox and display its multiplication table into the ListBox.

Form:- 

 Program:-

Public Class slip4

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim n As Integer

        ListBox1.Items.Clear()

        n = CInt(InputBox("Enter number: "))

        For i = 1 To 10

            ListBox1.Items.Add(n * i)

        Next

    End Sub

End Class

Design:-

1) Take  Button and ListBox on the design form.

2) Set Text on Button


Note - Set startup form's application type as Windows Form Application


0 Comments