arrays initial example

This commit is contained in:
Mert Gör 🇹🇷 2024-01-07 21:09:10 +03:00
parent 0f087948a0
commit ff632efdf9
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F
2 changed files with 12 additions and 0 deletions

10
arrays/arrays1.go Normal file
View File

@ -0,0 +1,10 @@
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
}

View File

@ -5,6 +5,7 @@ import (
"golesson/conditionals" "golesson/conditionals"
"golesson/loops" "golesson/loops"
"golesson/variables" "golesson/variables"
"golesson/arrays"
) )
func main() { func main() {
@ -12,4 +13,5 @@ func main() {
fmt.Print() fmt.Print()
conditionals.Demo3() conditionals.Demo3()
loops.Demo5() loops.Demo5()
arrays.Demo1()
} }