Skip to content

Commit 36da07f

Browse files
authored
Merge pull request #375 from amirhasanpour/patch-1
Update 1.11-if-switch.md for modifying nested condition example
2 parents cec5265 + fd9c3be commit 36da07f

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

content/chapter 1/1.11-if-switch.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,23 @@ package main
172172
import "fmt"
173173

174174
func main() {
175-
a := 1
176-
b := 2
177-
c := 3
178-
179-
if a > b && a > c {
180-
fmt.Println("Biggest is a")
181-
} else if b > a && b > c {
182-
fmt.Println("Biggest is b")
183-
} else {
184-
fmt.Println("Biggest is c")
185-
}
175+
a := 1
176+
b := 2
177+
c := 3
178+
179+
if a > b {
180+
if a > c {
181+
fmt.Println("Biggest is a")
182+
} else {
183+
fmt.Println("Biggest is c")
184+
}
185+
} else {
186+
if b > c {
187+
fmt.Println("Biggest is b")
188+
} else {
189+
fmt.Println("Biggest is c")
190+
}
191+
}
186192
}
187193
{{< /play >}}
188194

0 commit comments

Comments
 (0)