7. variable with zero value - programming in go

Posted on Mar 03, 2019   ∣  1 min read  ∣  GO

variable with zero value

  1. variable with zero value - programming in go
package main

import "fmt"

func main() {

	var a int
	var b string
	var c float64
	var d bool

	fmt.Printf("%v \n", a)
	fmt.Printf("%v \n", b)
	fmt.Printf("%v \n", c)
	fmt.Printf("%v \n", d)

	fmt.Println()
}

in this above program declared variable with its type so it will give zero values and for bool it will return false