Arithmetic Operators

Arithmetic operators are used to perform common mathematical operations.

Operator Name Description Example Try it
+ Addition Adds together two values x + y
- Subtraction Subtracts one value from another x - y
* Multiplication Multiplies two values x * y
/ Division Divides one value by another x / y
% Modulus Returns the division remainder x % y
++ Increment Increases the value of a variable by 1 x++
-- Decrement Decreases the value of a variable by 1 x--

Go Exercises

Test Yourself With Exercises

Exercise:

Multiply 10 with 5, and print the result.

package main   
import ("fmt") 
func main() { fmt.Print(105) }



Login
ADS CODE