Complete the code to skip printing the number 3 in the loop.
for i := 1; i <= 5; i++ { if i == 3 { [1] } fmt.Println(i) }
The continue statement skips the current iteration and moves to the next one, so number 3 is not printed.
Complete the code to skip even numbers when printing from 1 to 6.
for i := 1; i <= 6; i++ { if i%2 == 0 { [1] } fmt.Println(i) }
The continue statement skips printing even numbers by moving to the next loop iteration.
Fix the error in the loop to skip printing negative numbers.
numbers := []int{2, -1, 3, -4, 5}
for _, num := range numbers {
if num < 0 {
[1]
}
fmt.Println(num)
}Using continue skips printing negative numbers by moving to the next iteration.
Fill both blanks to skip printing numbers divisible by 3 in the loop.
for i := 1; i <= 10; i++ { if i [1] 3 == 0 { [2] } fmt.Println(i) }
The modulus operator % checks divisibility by 3, and continue skips printing those numbers.
Fill all three blanks to skip printing words shorter than 4 letters and convert others to uppercase.
words := []string{"go", "code", "fun", "learn"}
for _, word := range words {
if len(word) [1] 3 {
[2]
}
fmt.Println([3])
}Words with length less than or equal to 3 are skipped using continue. The rest are printed in uppercase using strings.ToUpper(word).