title: Program to check any number exist in 2D array
body: <p>I know how to check if number exist in the array, but not in a <em>2D array</em>.</p>
  <p>Please help me in 2D.</p>
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main()
  {
     int a[3] = { 4,5,6 };
     int b, c;
     int x = 1, fact = 1;
  
     cout &lt;&lt; &quot;enter no &quot;;
     cin &gt;&gt; b;
  
     for (int i = 0; i &lt; 3; i++) 
     {
        if (b == a[i]) {
           c = a[i];
           break;
        }
     }
     cout &lt;&lt; &quot;no entered is present&quot; &lt;&lt; endl;
  }
  </code></pre>