Debug program

Report a typo

Your friend Paul wrote a program that checks whether the number is even or odd. However, when he went to drink tea, his cat ran over the keyboard, and part of the code was changed. Help Paul recover the code.

Sample Input 1:

Sample Output 1:

Number 11 is odd
Number 22 is even
Number 33 is odd
Write a program in Go
package main

import "fmt"

func main() {
var array = []int{11, 22, 33}
for i := range array {
fmt.Print("Number %d is %s", array[i], isEven(i))
}
}

func isEven(num int) string {
if num % 2 == 1 {
return "even"
}
return "odd"
}
___

Create a free account to access the full topic