title: Program to find the Greatest and the Lowest value and it's index of an Array (C programming)
body: <p>Part of the code to find the Greatest and the Lowest number on an array,if that is needed.
  I need the index now. The position of those number in that array.</p>
  
  <p>//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #define DIM 5
  
  void lerArray (int x[DIM]);
  int maximo(int x[DIM]);
  int minimo(int x[DIM]);
  
  
  int main(){
      int a[DIM],l,g;
      lerArray(a);
      g = maximo(a);
      l = minimo(a);
  
      printf("Minimo:%d \t  Maximo:%d ",g,l);
  
  
      return 0;
  }
  
  
  void lerArray (int x[DIM]){
      int i,numb;
  
      for(i=0;i&lt;DIM;i++)
      {
          printf("Intoduza o %dº elemento\n",i);
              scanf("%d",&amp;numb);
              x[i]= numb;
      }
  }
  
  
  int maximo(int x[DIM]){
      int i,max;
      max =x[0];
  
      for(i=0;i&lt;DIM;i++){
          if (max&gt;x[i])
              max = x[i];
      }
      return max;
  }
  
  int minimo(int x[DIM]){
      int i,min;
      min =x[0];
  
      for(i=0;i&lt;DIM;i++){
          if(min&lt;x[i])
               min=x[i];
      }
  
      return min;
  }
  </code></pre>