๐Ÿงช Go Lang MCQ Quiz Hub

Go Lang mcq

Choose a topic to test your knowledge and improve your Go Lang skills

what is the output of below code snippet package main import ( "fmt" ) func main() { var x int lstArray := [3]int{1, 2, 3} x, lstArray = lstArray[0], lstArray[1:] fmt.Println( x, lstArray) }





โœ… Correct Answer: 3

what is the output of below code snippet package main import ( "fmt" ) func main() { var x int lstArray := []int{1, 2, 3} x, lstArray = lstArray[0], lstArray[1:] fmt.Println( x, lstArray) }





โœ… Correct Answer: 2

what is the output of below code snippet? package main import ( "fmt" ) func main() { var x int lstArray := [...]int{1, 2, 3} x, lstArray = lstArray[0], lstArray[1:] fmt.Println(x, lstArray) }





โœ… Correct Answer: 3

What is the output of below code snippet? package main import ( "fmt" ) func main() { x := [2]int{1,2} r := [...]int{1,2} fmt.Println(x==r) }





โœ… Correct Answer: 4

What is the output of below code snippet? package main import ( "fmt" ) func ElementChange(x [3]int) { x[2] = 5 } func main() { x := [3]int{1, 2} ElementChange(x) fmt.Println(x) }





โœ… Correct Answer: 3

What is the output of below code snippet?package mainimport ( "fmt")func main() { x := [...]string{1:"xyz", 2:"pqr"} fmt.Println(x[0],x[1])}





โœ… Correct Answer: 1

what is the output of below code snippet package main import "fmt" func main() { fmt.Println("Hello " + "World") }





โœ… Correct Answer: 2