22 lines
319 B
Go
22 lines
319 B
Go
/*
|
|
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 {
|
|
|
|
}
|
|
}
|
|
}
|