title: Find the smallest amongst 3 numbers in C++
body: <p>Is there any way to make this function more elegant? I'm new to C++, I don't know if there is a more standardized way to do this. Can this be turned into a loop so the number of variables isn't restricted as with my code?</p>
  
  <pre><code>float smallest(int x, int y, int z) {
  
    int smallest = 99999;
  
    if (x &lt; smallest)
      smallest=x;
    if (y &lt; smallest)
      smallest=y;
    if(z &lt; smallest)
      smallest=z;
  
    return smallest;
  }
  </code></pre>