title: find smallest positive number in an array
body: <p>So ... I have : int array[] = {-8,2,0,5,-3,6,0,9};</p>
  
  <p>I want to find the smallest positive number ( which in the list above is 2 )</p>
  
  <p>This is what i am doing :</p>
  
  <hr>
  
  <pre><code>int array[] = {-8,2,0,5,-3,6,0,9};
  
  int smallest=0;
  
  
          for(int i=0;i&lt;array.length;i++) // Find the first number in array&gt;0 (as initial           
                                           // value for int smallest)
          {
              if(array[i]&gt;0)
              {
                  smallest=array[i]; 
                  break;// Break out of loop, when you find the first number &gt;0
              }   
          }
  
  
          for(int i=0;i&lt;array.length;i++) // Loop to find the smallest number in array[]
          {
  
              if(smallest&gt;array[i]&amp;&amp;array[i]&gt;0)
              {
                  smallest=array[i];
  
              }
  
          }
  
          System.out.println(smallest);
  
          }
  </code></pre>
  
  <hr>
  
  <p>My question is :</p>
  
  <p>Can we reduce the number of steps ? 
  Is there any smarter/shorter way of doing it, with no other data structure.</p>
  
  <p>Thanks.</p>