title: im trying to find maximun and minimum between the rows in 2d array---- the minimum value code seems correct but not working
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  
  {
      int total, average, maximum, mininum;
  
      int a = 0;
      int b = 0;
      int c = 0;
      int x = 0;
      int y = 0;
      int tab[5][5] = { { 111, 2, 30, 4, 500 }, { 10, 20, 30, 40, 50 }, 
          {34, 54, 78, 9, 23,},
          { 65, 12, 98, 3, 78 }, { 34, 89, 23, 98, 45 } };
      string name[5] = { &quot;EMP1:EREN&quot;, &quot;EMP2:ARMIN&quot;, &quot;EMP3:MIKASA&quot;, &quot;EMP4:LEVI&quot;, &quot;EMP5:CONNIE&quot; };
  
      for (int c = 0; c &lt; 5; c++) {
  
          for (int a = 0; a &lt; 5; a++) {
              //cout&lt;&lt;total&lt;&lt;&quot;\n&quot;;
              cout &lt;&lt; tab[c][a] &lt;&lt; &quot;\n&quot;;
              3 total = total + tab[c][a];
              b = tab[c][a];
              for (tab[c][a] = 1; tab[c][a] &gt;= 300; tab[c][a]++);
  
              if (tab[c][a] &gt;= x) {
                  x = tab[c][a];
              }
  
              for (tab[c][a] = 1; tab[c][a] &lt; 5; tab[c][a]++);
  
              if (tab[c][a] &lt; b) {
  
                  y = tab[c][a];
              }
          }
          average = total / 5;
          cout &lt;&lt; &quot;I.D number &quot; &lt;&lt; name[c] &lt;&lt; &quot; \nThe total amount of sale:&quot; &lt;&lt; total;
          cout &lt;&lt; &quot;\nThe average sales is:&quot; &lt;&lt; average;
          cout &lt;&lt; &quot;\nThe Maximum sales is:&quot; &lt;&lt; x;
          cout &lt;&lt; &quot;\nThe Minimum sales is:&quot; &lt;&lt; y &lt;&lt; &quot;\n&quot;;
      }
  }
  </code></pre>