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
Modernizing Legacy Applications: Critical Tips for Organizational Upgrades
Golang program to generate number of slices permutations of number entered by user
How do you read cookies in an HTTP request with an HTTP client in Go?
Invalid operation: <variable> (type <type>) does not support indexing error in Golang
Golang program to read XML file into struct
Golang program for implementation of Huffman Coding Algorithm