gokursu/arrays/arrays.go

10 lines
No EOL
199 B
Go

package arrays
import "fmt"
func Demo1() {
var numbers [5]int
numbers[2]=50 // second index of the array
fmt.Println(numbers)
fmt.Println(numbers[2]) // will print second index of the array
}