Skip to content

mangila/is-odd-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

contributions welcome GoDoc Go Report Card GitHub go.mod Go version

is-odd-go

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.

Installation

go get github.com/github.com/mangila/is-odd-go

Usage

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
}

Contributors