Sobes.tech
Junior — Senior

What output will the program produce

livecode

Task condition

In this example, a user-defined type Count and a method Increment are declared, which increases the counter value. In the main function, a variable of this type is created, the Increment method is called, and then the value is printed to the screen. Determine what result will be printed.

 type Count int

func (c Count) Increment() {
  c++
}

func main() {
  var count Count
  count.Increment()
  fmt.Print(count)
}