# Golang Program to Print the Multiplication Table of a Given Number

Go ProgrammingServer Side ProgrammingProgramming

## Steps

• Read a number and store it in a variable.
• Print the multiplication table of the given number.
 Enter the number to print the table for: 77 x 1 = 77 x 2 = 147 x 3 = 217 x 4 = 287 x 5 = 357 x 6 = 427 x 7 = 497 x 8 = 567 x 9 = 637 x 10 = 70 Enter the number to print the table for: 1717 x 1 = 717 x 2 = 3417 x 3 = 5117 x 4 = 6817 x 5 = 8517 x 6 = 10217 x 7 = 11917 x 8 = 13617 x 9 = 15317 x 10 = 170

## Explanation

• User must enter a number.
• Using a print statement, print the multiplication table of the given number.

## Example

Live Demo

package main
import "fmt"
func main(){
var n int
fmt.Print("Enter the number to print the multiplication table:")
fmt.Scanf("%d", &n)
for i:=1; i<11; i++ {
fmt.Println(n, "x", i, "=", n*i)
}
}

## Output

Enter the number to print the multiplication table: 7
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70