Search⌘ K
AI Features

Quiz: Deduce the Outputs

Explore your understanding of Go's fundamental constructs and elementary data types by deducing the outputs in this quiz. This lesson helps reinforce key concepts to prepare for control structures in subsequent chapters.

We'll cover the following...

Choose one correct answer

1.

Deduce the output of the following program.

package main
var a = "G"
func main() {
   n()

   m()
   n()
}
func n() { print(a) }
func m() {
  a := "O"
  print(a)
}
A.

OGO

B.

GOG

C.

GOO

D.

OGG


1 / 3
...