title: Lambda expression to find greatest among 3 numbers
body: <p>Background: I am trying to write a shortest possible lambda expression to find the greatest of 3 numbers.
  Of course ternery operator is capable of doing it.</p>
  
  <pre><code>Func&lt;int, int, int, int&gt; greatestNumber2 = (x, y, z) =&gt; (x &gt; y) ? ((x &gt; z) ? x : z) : ((y &gt; z) ? y : z);
  </code></pre>
  
  <p>But my intention is to achieve a function such as the one below.</p>
  
  <pre><code>greatest (x, y, z) = if (greater (x, y)&gt;z) then greater(x, y) else z;
  </code></pre>
  
  <p>I was able to do this in two ways.</p>
  
  <pre><code>            Func&lt;int, int, int&gt; greaterNumber = null;
              Func&lt;int, int, int, int&gt; greatestNumber = null;
  
              //Expression 1
              greaterNumber = (x, y) =&gt; x &gt; y ? x : y;
              greatestNumber = (x, y, z) =&gt; greaterNumber(x, y) &gt; z ? greaterNumber(x, y) : z;
  
              //Expression 2
              greatestNumber = (x, y, z) =&gt; {
                  Func&lt;int, int, int&gt; greater = (i, j) =&gt; i &gt; j ? i : j;
                  return greater(x, y) &gt; z ? greater(x, y) : z;
              };
  </code></pre>
  
  <p>In the Expression 2, I was able to somehow achieve the what I wanted i.e define the function to find the greater among two numbers from the same expression itself. However, it is a statment lambda.</p>
  
  <p>Is there a way to write a single lined lambda to define and use the greater of 2 numbers from within the expression of greatest itself.</p>