Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Find the maximum number between 2 positive integers (without compare operation, ternary operation)
int getMax(int a, int b) {
return ((a + b) + abs(a - b))/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment