What possible changes in the below code so that there is no infinite looping and output of the code is: 1
Note: Assume all the necessary imports are done
(Choose 2 correct options)

for i := 0; ; i += 2 { //………Line1
if i%2 == 1 {
continue //………Line2
}
fmt.Println(i + 1) //………Line3
i++
}

Line1: Change i += 2 to i += 1

Line2: Change continue to break

Line3: Replace fmt.Println(i+1) with fmt.Println(i)

Line1: Add condition in loop: i < 3

Verified Answer
Correct Option - bd

To get all Infosys Certified Go Programmer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in