Skip to content

Commit

Permalink
Array Learning
Browse files Browse the repository at this point in the history
  • Loading branch information
ProLord007 committed Jun 3, 2023
1 parent fbd8c5f commit af60979
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions chapter1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ func f(n int) bool {
}
return true
}

func main() {
var b int = 5
fmt.Scanf("%d", &b)
fmt.Println(f(b))
arr := []int{1, 2, 3, 4, 5}
fmt.Println("Enter 5 integers:")
arr = append(arr, 2, 3, 4, 5, 6, 7, 989, 0)
fmt.Println("Array elements are:")
for i := 0; i < len(arr); i++ {
fmt.Println(arr[i])
}
}

0 comments on commit af60979

Please sign in to comment.