title: Finding smallest value in an array
body: <p>I am trying to write a function to find the smallest value in an array, but i cannot figure out the error i have made. Can someone take a look at it? thanks!!!</p>
  
  <pre><code>void smallest(int array[],int size)
      {
          int smallest=array[0];
              for (int i=1;i&lt;size-1;i++)
                  {
                  if (array[i]&lt;smallest)
  
                   smallest=array[i];
  
                  }
          cout&lt;&lt;smallest&lt;&lt;'\n';
  
       }
  </code></pre>
  
  <p>the code are not executed because there is breakpoint, and I cannot see where is the problem. </p>