I tried the project module say the number which part is wrong? | SoloLearn: Learn to code for FREE!

0

I tried the project module say the number which part is wrong?

package main import "fmt" func main() { //your code goes here x := 1 if x == 1 { fmt.Println("One") } else if x == 2 { fmt.Println("Two") } else { fmt.Println("Three") } }

5/17/2021 1:03:18 AM

Mokh. Aria Wirakusumah

2 Answers

New Answer

+1

Just loop over the switch 3 times

0

Your code will print "one", because x=1, and your not taking inputs. if/else statements are fine. But I suggest to use switch.