title: Finding the second largest element in array without sorting
body: <p>I know about the single traversal method initialising two variables to <code>INT_MIN</code>. But my question is why do we initialise two variables to <code>INT_MIN</code> and also what is the purpose of <code>INT_MIN</code> here? </p>
  
  <p>Why can't we initialise two variables to its first element like I have done in the code below? Because when I hand-checked the code manually, I found nothing wrong. So why doesn't the code run properly? </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      int x[10];
      int i, n;
      int first = x[0];
      int second = x[0];
  
      printf("Input the size of array :");
      scanf("%d", &amp;n);
  
      printf("Input %d elements in the array :\n", n);
      for (i = 0; i &lt; n; i++) {
          printf("x[%d]: ", i);
          scanf("%d", &amp;x[i]);
      }
  
      for (i = 0; i &lt; n; ++i) {
          if (first &lt; x[i]) {
              second = first;
              first = x[i];
          } else
          if (x[i] &gt; second &amp;&amp; x[i] != first) {
              second = x[i];
          }
      }
  
      if (second == first)
          printf("There is no second largest element\n");
      else
          printf("\nThe Second largest element in the array is: %d", second);
  
      return 0;
  }
  </code></pre>