title: Counting occurrences of the largest number
body: <p>I have been attempting to code for a program that stores input into an array and then allows me to print it out. It also lets me know which number is the largest. What I am trying to figure out is how can I get my program to tell me the amount of times (occurrences) the largest number in array is input. Here is my code so far. As of now, this code outputs the numbers I enter to the array, the largest element in the array, and the occurrence of every number I input( The occurrences of the numbers are incorrect). In all the the amount of occurrences for every number turns out to be 0. Which is obviously incorrect. Again, I need my program to display the largest number (which it does) and the occurrences of ONLY the largest number. All advice, tips, or thoughts are welcome. Thank you. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  #include &lt;ctype.h&gt;
  
  
  
  int main()
  {
  int arrayNum[15];
  int a;
  int max=0;
  int location;
  
  
  for( a=0; a &lt; 15; a++)
      {   
          printf("Enter element %d:", a);
          scanf("%d",&amp;arrayNum[a]);
      }
  
  for(a=0; a &lt; 15; a++)
      {
          printf("%d\n", arrayNum[a]);
      }
  
  for (a = 1; a &lt; 15; a++)
    {
      if (arrayNum[a] &gt; max)
      {
         max  = arrayNum[a];
         location = a+1;
      }
      }
  printf("Max element in the array in the location %d and its value %d\n", location, max);
  
  for(a=0; a&lt;15; a++)
      {
          if(arrayNum[a+1] == arrayNum[a])
              continue;
          else
              printf("Number %d: %d occurences\n", arrayNum[a]);
      }
  return 0;
  
  
  
  
  
  }
  </code></pre>