Go Arithmetic Operators

Arithmetic operators in Go are utilized for performing essential mathematical operations. Below are the types of arithmetic operators and their description:

Tutorials dojo strip
OperatorNameDescriptionExample
+AdditionCombines two values into a single sum.x + y
-SubtractionReduces one value by another.x - y
*MultiplicationMultiplies two values together.x * y
/DivisionDivides one value by another.x / y
%ModulusReturns the remainder after division.x % y
++IncrementIncreases the value of a variable by 1.x++
--DecrementDecreases the value of a variable by 1.x--




Example Code

Go

Tutorials dojo strip