Write a Visual basic program to Create a table
How to create a multiplication table in visual basic. In this example, will see How to write a visual basic program. Another example to perform mathematical operations in visual basic.
A table is a list of multiples of a particular number, typically from 1 to 12. Let’s see how to write a visual basic program to generate a table of a number.
What is a multiplication table
A multiplication table is a list of multiple of a particular number from 1 to 12. it is a mathematical operation. Formula to find the table of a number is n*i = T. Where T= table, n is the number and i is multiply number. Let’s see an example of the table of 2.
2*1 = 2
2*2 = 4
2*3 = 6
2*4 = 8
2*5 = 10
2*6 = 12
2*7 = 14
2*8 = 16
2*9 = 18
2*10 = 20
Algorithm to create multiplication table
Below are the steps to write a code to create a table in visual basic.
- Enter the number (int a = number).
- Execute a loop from 1 to 10. (i=0 to 10)
- Print(number * i)
Write a Visual Basic program to create a table of a number
Module Module1 Sub Main() Dim a As Integer a = 10 For i = 1 To a Console.WriteLine("10 * " & i & " = " & (i * a)) Next Console.ReadLine() End Sub End Module
Output: Table of 10
10*1 = 10
10*2 = 20
10*3 = 30
10*4 = 40
10*5 = 50
10*6 = 60
10*7 = 70
10*8 = 80
10*9 = 90
10*10 = 100