go-examples

Get Set Learn Go


Project maintained by sagar-jadhav Hosted on GitHub Pages — Theme by mattgraham

Boolean-Expressions

Example demonstrates different boolean expressions in Go like ||,&&,!. Click here to learn more

func main() {
	fmt.Println("true && false = ", (true && false))
	fmt.Println("true || false = ", (true || false))
	fmt.Println("!true = ", !true)
}

Output

true && false =  false
true || false =  true
!true =  false
Try It Out Source code

Contributors

« Home Page Previous « Recursion Next » Comparison Operators