Go
Example
if 7%2 == 0 {
fmt.Println("7 is even")
} else {
fmt.Println("7 is odd")
}
Output
7 is odd
Example
for i := 0; i < 10; i++ {
sum += i
}
Example
studentGrades := [3]int{50, 89, 75}
for _, grade := range studentGrades {
fmt.Println("Grade: ", grade)
}
Output
N/A
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up