title: Array occurence
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main() {
      int n, count;
      
      //enter the size of the array
      cout &lt;&lt; &quot;Enter the size of the array: &quot;;
      cin &gt;&gt; n;
      
      //declare input and visited array, both of size 'n'
      int array[n], visited[n];
      
      //take inputs in the array
      cout &lt;&lt; &quot;Enter &quot; &lt;&lt; n &lt;&lt; &quot; numbers in the array: &quot;;
      for(int i=0; i&lt;n; i++){
          cin &gt;&gt; array[i];
      }
      
      //loop through the elements of the array
      for(int i=0; i&lt;n; i++){
          //check if the element has already been counted (visited)
          //if so, then skip the element
  
  ***Help me to understand from here***
          if(visited[i] == 1)
              continue;
           
          //otherwise, check the match with every element of the array
          count = 0;   
          for(int j=0; j&lt;n; j++){
              if(array[i] == array[j]){
                  //if the match is found:
                  //1. increment the count, and
                  //2. mark it visited
                  visited[j] = 1;
                  count++;
              }
          }
          //output the count
          cout &lt;&lt; array[i] &lt;&lt; &quot;: &quot; &lt;&lt; count &lt;&lt; endl;
      }
  
      return 0;
  </code></pre>
  <p>** Help me to understand program works
  While visited[i]==1 ; what it mean?
  while compareing array[i] and array[j]</p>