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) }
1.False
2.Compile time Error
3.Run time Error
4.True
Posted Date:-2022-09-17 16:41:44
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])}
1.Space xyz
2.only xyz
3.xyz pqr
4.None of the above
Posted Date:-2022-09-17 16:45:30
what is the output of below code snippet package main import "fmt" func main() { fmt.Println("Hello " + "World") }
1..Hello
2.Hello World
3.Compile error
4.None of the above
Posted Date:-2022-09-17 16:48:35
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) }
1.1 [2,3]
2. 1 [1,2,3]
3.Error
4.None of the above
Posted Date:-2022-09-17 16:28:40
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) }
1. [1,2,3]
2.. 1 [2,3]
3.Error
4.None of the above
Posted Date:-2022-09-17 16:30:21
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) }
1..[1 2 5]
2.[1 2]
3. [1 2 0]
4.None of the above
Posted Date:-2022-09-17 16:44:30
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) }
1.1 [1 2 3]
2. 1 [2 3]
3.Error
4.None of the above
Posted Date:-2022-09-17 16:40:21