Last active
September 18, 2019 08:51
-
-
Save Bablzz/88431e2f3baebd350b7a97bdacbb0a9e to your computer and use it in GitHub Desktop.
Max digit without condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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