Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Golang - Level 7 - lesson 5

Please share correct answer
by

1 Answer

sam5epi0l
Here is a possible solution:


package main
import "fmt"

func negate(myBool *bool) {
*myBool = !(*myBool)
}

func main() {
truth := true
negate(&truth)
fmt.Println(truth)

lie := false
negate(&lie)
fmt.Println(lie)
}

Login / Signup to Answer the Question.