Write a Go program that will store the values of your name and age in variables (or constants), and will print the following sentence using the variables you defined:
My name is ___ and I'm ___ years old
Explain why the following program will fail?
package main import"fmt"funcmain() { fmt.Println("Skynet Beta Testing") varobjective="Defend Humanity" }
- What's the output of the following program?
package main import"fmt"funcmain() { constsquares=2varcircles=0fmt.Println("Squares:", squares) fmt.Println("Circles:", circles) squares=1circles=7fmt.Println("Squares:", squares) fmt.Println("Circles:", circles) }
Click here to view the solution