title: What is the easiest way to test if certain values exist in mutliple arrays?
body: <p>I know this might seem like hw question, and be my guest to treat it as such because this is a self-learning exercise.</p>
  
  <p>What would be the easiest way to test if certain values exist within mutliple arrays?</p>
  
  <p><strong>For example:</strong></p>
  
  <p>Pseudo code</p>
  
  <pre><code>if array a contains a value of 4 and
     array b contains a value of 2 and
     array c contains a value of 6 
  then procede to procedure x
  </code></pre>
  
  <p>What I have so far in implementation</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  void x(void){/* do stuff */}
  
  int main()
  {
      char fndA = 0;
      char fndB = 0;
      char fndC = 0;
  
      int a[5] = {1,2,3,5,6};    
      int b[5] = {1,2,2,3,4};
      int c[5] = {1,3,4,5,6};
  
      for(int i=0;i&lt;5;i++)
      {
          if(a[i]==4){fndA=1;}
      }
  
      //repeat for-loop for b/fndb and c/fndC
  
      if (fndA &amp;&amp; fndB &amp;&amp; fndC) {x();}
  
      return 0;
  }
  </code></pre>
  
  <p>In this example, <code>x()</code> never gets called because a 4 does not exis in array <code>a</code>.  But will I ultimately have to build a <code>for</code> loop for each array I want to test?  Thanks</p>