title: skip/ignore array index that contain value in c
body: <p>My goal is to create a C function that finds the minimum value of an array and set it to zero. So far, my function does that but I would like it to ignore/skip indexes that are already zero. </p>
  
  <pre><code>void find_minimum(double a[], int n) {
  
      int i, index;
      double low;    
  
      index = 0;
      low = a[0];
  
      for (i = 1; i &lt; n; i++) {
          if ( a[i] &lt; low &amp;&amp; a[i] != 0.0) {
              low = a[i];
              index = i;
          }
      }
      a[index] = 0.0;      
  }
  </code></pre>
  
  <p>I also tried using a <code>continue</code> statement like this:</p>
  
  <pre><code>void find_minimum(double a[],  int n) {
  
      int i, index;
      double low;
  
      index = 0;
      low = a[0];
  
      for (i = 1; i &lt; n; i++) {
  
          if(a[i] == 0.0){
            continue;
          }
          if ( a[i] &lt; low) {
              low = a[i];
              index = i;
          }
      }
      a[index] = 0.0;
  }
  </code></pre>
  
  <p>What am I missing or messing up?</p>