title: Compare elements of an array to all elements of another array
body: <p>I would like to compare each element of one array to all elements of another array. What I want to achieve is if an element exists in another array, result =0, otherwise result =1</p>
  
  <pre><code>int m,n;
  
  for(int i=0; i&lt;m; i++) {
    for(int j=0; j&lt;n; j++) {
      if(i==j) {
        result =0;
        //perform a task
         break;
      } 
  
       if(i!=j) {
         result = 1;
        //perform another task
        break
       }
  
    }
  }
  </code></pre>
  
  <p>however, i fail to achieve what i want in the second if ()</p>