diff --git a/golangr/array/go.mod b/golangr/array/go.mod new file mode 100644 index 0000000..29cf170 --- /dev/null +++ b/golangr/array/go.mod @@ -0,0 +1,3 @@ +module array + +go 1.21.6 diff --git a/golangr/array/main.go b/golangr/array/main.go new file mode 100644 index 0000000..3f99eff --- /dev/null +++ b/golangr/array/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" +) + +func main() { + + var notafinal int = 0 + + numbers := []int{9, 9, 10} + + for i := 0; i < len(numbers); i++ { + notafinal = notafinal + numbers[i] + } + + fmt.Println("La notas combinadas suman", notafinal) + // numbers = append(numbers, 1) + // fmt.Println(len(numbers)) + // fmt.Println(numbers) +}