Skip to main content
3 of 4
Add language tag for syntax highlighting
Paul R
  • 2.9k
  • 1
  • 18
  • 22

C: 10 tokens##

int max(int a, int b, int c)
{
    a += (b > a) * (b - a);
    a += (c > a) * (c - a);
    return a;
}

Inspired by @openorclose's answer, but converted to C and made branchless using multiplication rather than short circuit boolean operators.

Paul R
  • 2.9k
  • 1
  • 18
  • 22