# Multiplication Table in VB.NET

Hi! this is me again! For now we will have to create a Multiplication Table using VB.NET.

So, now let's start this tutorial!

1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.

2. Next, add Three TextBoxes namely TextBox1 for entering the first number, TextBox2 for entering the number limit, and TextBox3 for the result of the Multiplication Table. You must design your layout like this:

3. Next, put this code in Button1_Click so that it will display the Multiplication table.

`Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim n1, n2, i As Integer        n1 = Val(TextBox1.Text)        n2 = Val(TextBox2.Text)         For i = 1 To n2            Dim a As Integer            a = n1 * i            TextBox3.Text = TextBox3.Text & n1 & " * " & i & " = " & a            TextBox3.Text = TextBox3.Text & vbCrLf        Next    End Sub`

#### Explanation:

We initialized `n1, n2 as Integer` because we passed the value of our input in TextBox1 to n1 and TextBox2 to n2.

`For i = 1 To n2            Dim a As Integer            a = n1 * i            TextBox3.Text = TextBox3.Text & n1 & " * " & i & " = " & a            TextBox3.Text = TextBox3.Text & vbCrLf        Next`

`For i = 1 To n2` - our variable i will start at 1 up to the n2 as we input it in TextBox2. Next, we initialized a as Integer to have the result of multiplication done in n1 up to the value of i which limits at n2. Then, TextBox3 will now have the value of n1*i = a. We use `vbCrLf` to create a newline.

Now, input 8 in TextBox1 and 10 in TexBox2 then click the Button. It will have a multiplication table like the image below.

For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.

Best Regards,

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
STI College - Surigao City
Mobile: 09488225971
E-mail:[email protected]

### Tags

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.