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
GO Program to Calculate Sum of Natural Numbers Using for.....Loop
Program in Go language to Calculate Average Using Arrays
GO language program with example of Array Reverse Sort Functions for integer and strings
GO Program to Check Whether a Number is Even or Odd
Program in Go language to print Pascal's Triangle
GO Program to print full Pyramid using *