Finding the max random number
<p>I am instructed to find the max number generated from a 2D array: arr[10][10]. Is this code correct? To me its seems to work.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;ctime&gt;
#include &lt;cstdlib&gt;
using namespace std;

int maxArray(int arr[][10], int rcap, int ccap) {
    int max = arr[10][10]; srand(time(0));
    for (int r=0; r &lt; rcap; r++)
        for(int c=0; c &lt; ccap; c++)
            if(arr[r][c] &gt; max) max = (rand()%100)+100;

    return max;
}

int main() {
    int a[10][10];
    cout &lt;&lt; maxArray (a,10,10) &lt;&lt;endl;
    return 0;
}
</code></pre>
