123456789101112131415161718192021
#include <iostream> using namespace std; int biggestEntry(int a[][3],int rowcap, int colcap){ int ans=a[0][0]; for(int r=0; r<=rowcap-1; r++){ for(int c=0; c<=colcap-1; c++) if(a[r][c]>ans) ans=a[r][c]; } return rowcap; } int main () { //biggestEntry: //cout << "Testing biggestEntry: "; int arr1 [2][3] = {{1, 8, 3}, {4, 7, 3}}; //cout << biggestEntry (arr1, 2, 3) << endl; //prints: 8, return 0; }
123456
int main () { int arr1 [2][3] = {{1, 8, 3}, {4, 7, 3}}; return 0; }