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
Exploring Blockchain: Top 15 Real-World Use Cases in 2024
Interfaces with similar methods in Go Programming Language
How do you handle HTTP client caching in Go?
Golang program for implementation LIFO Stack and FIFO Queue
GO Program to Find the Largest Number Among Three Numbers
How to read current directory using Readdir?