When you are in trouble and can't decide if the number is odd or even. This go utility will solve it for you.
- If the number ends in 2, 4, 6, 8, or 0, then the number is even.
- If the number ends in 1, 3, 5, 7, or 9, then the number is odd.
go get github.com/github.com/mangila/is-odd-go
package main
import (
"fmt"
"github.com/mangila/is-odd-go/iseven"
"github.com/mangila/is-odd-go/isodd"
)
func main() {
fmt.Println(isodd.IsOdd(5)) // true
fmt.Println(isodd.IsOdd(4)) // false
fmt.Println(iseven.IsEven(5)) // false
fmt.Println(iseven.IsEven(4)) // true
}