Skip to content

Instantly share code, notes, and snippets.

@Bablzz
Last active September 18, 2019 08:51
Show Gist options
  • Save Bablzz/88431e2f3baebd350b7a97bdacbb0a9e to your computer and use it in GitHub Desktop.
Save Bablzz/88431e2f3baebd350b7a97bdacbb0a9e to your computer and use it in GitHub Desktop.
Max digit without condition
package main
import (
"fmt"
"math"
)
func main() {
a := 32
b := -44
max := ( a + b + (int)(math.Abs(float64(a-b))))/2
fmt.Println("Max digit = ", max)
}
// output => Max digit = 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment