Assignment Operators
var a int a = 10x := 5 x += 3 // x = x + 3 fmt.Println(x) // 8x := 10 x -= 4 // x = x - 4 fmt.Println(x) // 6x := 6 x *= 7 // x = x * 7 fmt.Println(x) // 42x := 20 x /= 4 // x = x / 4 fmt.Println(x) // 5x := 17 x %= 5 // x = x % 5 fmt.Println(x) // 2
Misal
Nəticə
Last updated