Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- func main() {
- slice := make([]int, 5)
- for i := 0; i < len(slice); i++ {
- n := i + 1
- slice[i] = n * n
- }
- for _, e := range slice {
- fmt.Println(e)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement