- What is the result of the following program? Why?
package main
import "fmt"
func main() {
var userName
userName = "user"
fmt.Println(userName)
}
- What is the result of the following program? Why?
package main
import "fmt"
func main() {
var userName = "user"
fmt.Println(userName)
}
- Fix the following program by modifying one of the lines (but not adding or removing lines)
package main
import "fmt"
func main() {
var userName
userName = "user"
fmt.Println(userName)
}
- Modify the following program to print the types of the variables
package main
import "fmt"
func main() {
var food = "Pizza"
var slices = 4
var pineappleOnPizza = true
}
Click here to view the solution