
Smallest odd
Write a function smallestOdd(numbers []int) int
that, given a slice of integers, returns the smallest odd number in the slice (the slice may contain both positive and negative numbers).
To test the function you can use the main
below:
func main() {
const N = 10
:= make([]int, N)
numbers
for i := 0; i < N; i++ {
.Scan(&numbers[i])
fmt}
.Println(smallestOdd(numbers)
fmt}