fix: precedence and assignment operator questions
This commit is contained in:
@ -36,4 +36,7 @@ func main() {
|
||||
|
||||
// This expression should print 15
|
||||
fmt.Println(10 / 2 * 10 % 7)
|
||||
|
||||
// This expression should print 40
|
||||
fmt.Println(100 / 5 / 2)
|
||||
}
|
||||
|
@ -27,4 +27,7 @@ func main() {
|
||||
|
||||
// 10 / 2 * 10 % 7
|
||||
fmt.Println(10 / 2 * (10 % 7))
|
||||
|
||||
// 100 / 5 / 2
|
||||
fmt.Println(100 / (5 / 2))
|
||||
}
|
||||
|
Reference in New Issue
Block a user