What is the output of the following code snippet?
//Assume all necessary imports are done
func main() {
balance := 1000
expense := 200
if balance = balance - expense; balance >= 1000 {
fmt.Println("Option1")
} else if balance = balance + expense; balance < 1500 {
fmt.Println("Option2")
}
else if balance = balance / expense; balance == 5 {
fmt.Println("Option3")
} else {
fmt.Println("Option4")
}
}

Option4

Option2

Option3

Syntax Error: else in new line

Verified Answer
Correct Option - d

To get all Infosys Certified Go Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram