title: How do i get the index of a 2D array if the user enters a number from the array
body: <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int main()
  {
      int f[5][5], k = 1, n;
      for (int p = 0; p&lt;5; p++)
      {
          cout &lt;&lt; "Enter Elements Of Rows: " &lt;&lt; k &lt;&lt; endl;
          k++;
          for (int m = 0; m&lt;5; m++)
          {
              cin &gt;&gt; f[p][m];//It take's rows as input
          }
      }
      //What should i do now because i can't understand how to print the index of n element.
      cout &lt;&lt; "Enter the number you want to search:  ";
      cin &gt;&gt; n;
      //What should i do after this to get the index of the number n?
  }
  </code></pre>
  
  <p>This code is all good for taking rows as input but when it comes to index, everything goes horribly wrong. Searched and worked a lot but couldn't find anything. </p>