Coin Toss

Report a typo

Let's create a project that imitates a coin toss.

Using a random number generator create a simple project where the output is TAILS if the random number is between [0, 0.5) and HEADS if it is between [0.5, 1.0).

The input is the Seed number, and the output is either TAILS or HEADS according to the abovementioned conditions.

Sample Input 1:

10

Sample Output 1:

HEADS
Write a program in Go
package main

import (
"fmt"
"math/rand"
)

func main() {
var seed int64
fmt.Scanln(&seed)
rand.Seed(seed)

// put your code here

}
___

Create a free account to access the full topic