Quiz: Deduce the Outputs

In this lesson your concepts will be evaluated through a quiz.

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

Question 1 of 120 attempted

Get hands-on with 1200+ tech skills courses.