GO Program to Check Whether a Number is Even or Odd
In this program, if..else... conditional statement is used to check weather a number entered by user is Even or Odd.
Example
// Simple Program to Check Entered Number is Even or Odd
package main
import "fmt"
func main(){
fmt.Print("Enter number : ")
var n int
fmt.Scanln(&n)
/* Conditional Statement if .... else ........ */
if(n%2==0){
fmt.Println(n,"is Even number")
}else{
fmt.Println(n,"is Odd number")
}
}
Most Helpful This Week
GO Program to Find LCM and GCD of given two numbers
GO Program to Calculate Area of Rectangle and Square
Program in Go language to Calculate Average Using Arrays
GO supports the standard arithmetic operators: (Addition, Subtraction, Multiplication, Division,Remainder)
Contains, ContainsAny, Count and EqualFold string functions in Go Language
GO Program to Check Whether a Number is Palindrome or Not