Search⌘ K
AI Features

Quiz: Deduce the Outputs

Assess your knowledge of Go arrays and slices by deducing outputs in this quiz. This lesson helps reinforce your skills in array and slice manipulation before moving to maps.

We'll cover the following...

Choose one correct answer

1.

What is the output of the following code snippet?

a := [...]string{"a", "b", "c", "d"}

for i := range a {
	fmt.Println("Array item", i, "is", a[i])
}
A.

Array item 0 is a

Array item 1 is b

Array item 2 is c

B.

Array item 0 is a

Array item 1 is b

Array item 2 is c

Array item 3 is d

C.

Compiler error

D.

None of the above


1 / 12
...