- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Golang Program to Print the Multiplication Table of a Given Number
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: 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 | Enter the number to print the table
for: 17 17 x 1 = 7 17 x 2 = 34 17 x 3 = 51 17 x 4 = 68 17 x 5 = 85 17 x 6 = 102 17 x 7 = 119 17 x 8 = 136 17 x 9 = 153 17 x 10 = 170 |
Explanation
- User must enter a number.
- Using a print statement, print the multiplication table of the given number.
Example
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
- Related Articles
- Print multiplication table of a given number in C
- Java program to print a multiplication table for any number
- Java Program to Print the Multiplication Table in Triangular Form
- Haskell Program to Print the Multiplication Table in Triangular Form
- C++ Program to Print the Multiplication Table in Triangular Form
- Golang Program to Print all Numbers in a Range Divisible by a Given Number
- C program to print multiplication table by using for Loop
- Golang Program to find the parity of a given number.
- Golang Program to Print Odd Numbers Within a Given Range
- Golang Program to get the magnitude of the given number
- Golang Program to check the power of 4 of a given number
- Java program to print the reverse of the given number
- Java program to print the factorial of the given number
- C Program to represent a multiplication table.
- Golang Program to toggle the Kth of the given number n.

Advertisements