Advertisement
cwchen

[Go] Arithmetic operators

Sep 9th, 2017
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.20 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     a := 3
  9.     b := 2
  10.  
  11.     fmt.Println(a + b) // 5
  12.     fmt.Println(a - b) // 1
  13.     fmt.Println(a * b) // 6
  14.     fmt.Println(a / b) // 1
  15.     fmt.Println(a % b) // 1
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement