Write a program that finds the smallest number in this list:
x := []int{
48,96,86,68,
57,82,63,70,
37,34,83,27,
19,97, 9,17,
}Write a program that finds the smallest number in this list:
package main
import "fmt"
x := []int{
48,96,86,68,
57,82,63,70,
37,34,83,27,
19,97, 9,17,
}func main() {
answer := 0 ;
for i:= 1; i <= len(x) ; i++ {
if x[i] > answer {
answer = x[i]
}
fmt.Println(answer)
}
}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.