GO Program to Generate Multiplication Table
Example to generate the multiplication table of a number (entered by the user) using for loop in a while loop style.
Example
package main
import "fmt"
func main(){
var n int
fmt.Print("Enter any Integer Number : ")
fmt.Scan(&n)
i:=1
/* For loop as a Go's While */
for {
if(i>10){
break;
}
fmt.Println(n," X ",i," = ",n*i)
i++
}
}
Most Helpful This Week
Illustration of Sleeping Barber Problem in Golang
Empty Interface Type in Go Programming Language
What is Struct
Contains, ContainsAny, Count and EqualFold string functions in Go Language
Multiple-value <function> in single-value context error in Golang
How to create Slice using new keyword in Golang?