Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

try this :
package main
import (
"fmt"
"math/rand"
)

func main() {
target := rand.Intn(100) + 1
fmt.Println(target)
}
or this
package main
import (
"fmt"
"math/rand"
)

func main() {
target := rand.Intn(100)
fmt.Println(target + 1)
}

again you're not adding one in either case , while i suggested to only add it in one of the lines .
4 months ago
you don't need to do this twice "target := rand.Intn(100) + 1
fmt.Println(target + 1) " your basicly prints target +2 .
hope this hint helps
4 months ago
fmt.Println(target + 1) .... this edit worked
4 months ago