Determine the output of each fmt.Println() statement in the…
Determine the output of each fmt.Println() statement in the following Go code block by selecting the correct answer at the end of the fmt.Println() statement. s := []int{11, 12, 13, 14, 15, 16} s = s[:0] fmt.Println(“len=”, len(s), “cap=”, cap(s)) //output: [output2] s = s[:5] fmt.Println(“len=”, len(s), “cap=”, cap(s)) //output: [output3] s = s[3:] fmt.Println(“len=”, len(s), “cap=”, cap(s)) //output: [output4]
Read Details