daily pastebin goal
4%
SHARE
TWEET

[Go] Arithmetic operators

cwchen Sep 9th, 2017 331 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top