GO supports the standard arithmetic operators: (Addition, Subtraction, Multiplication, Division,Remainder)
Basic GO program to display of standard arithmetic operators with 2 integer values.It contains the main package line, the fmt import line, and the main function declaration, and it uses the Println function.
Example
package main
import "fmt"
func main() {
fmt.Println("1 + 2 = ",1+2) // Addition
fmt.Println("5 * 2 = ",5*2) // Multiplication
fmt.Println("10 - 2 = ",10-2) // Subtraction
fmt.Println("10 / 2 = ",10/2) // Division
fmt.Println("10 % 2 = ",10%2) // Remainder
}
Most Helpful This Week
Program in Go language to print Pascal's Triangle
Program in Go language to Program to Add Two Matrix Using Multi-dimensional Arrays
GO Program to Generate Fibonacci Sequence Up to a Certain Number
Program in Go language to Calculate Average Using Arrays
GO Hello World program
GO Program to Find LCM and GCD of given two numbers