Section9-ex2

This commit is contained in:
2023-11-08 13:19:00 +01:00
parent d9515dfc6d
commit e98d21c4e1
3 changed files with 98 additions and 0 deletions

21
Section9/76-2.go Normal file
View File

@@ -0,0 +1,21 @@
/*
Coding Exercise #2
Consider the following array declaration:
nums := [...]int{30, -1, -6, 90, -6}
Write a Go program that counts the number of positive even numbers
in the array.
*/
package main
func main() {
nums := [...]int{30, -1, -6, 90, -6}
for i := 0; i < len(nums); i++ {
if i > 0 && i%2 {
}
}
}