Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shockalotti/42793824bf99813eb4a1 to your computer and use it in GitHub Desktop.
Save shockalotti/42793824bf99813eb4a1 to your computer and use it in GitHub Desktop.
Go Golang - find highest and lowest number
package main
import "fmt"
func main() {
x:= []int {
48,96,86,68,
57,82,63,70,
37,34,83,27,
19,97,9,17,
}
min:=x[0]
for i:=0; i<len(x); i++ {
if x[i] < min {
min = x[i]
}
}
fmt.Println(min,"is the lowest number in the range")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment