Answer:
Follows are the method definition to this question:
int even(int A[MAX_ROWS][MAX_COLUMNS], int length,int width)//defining a method even,that accept 2D array and two integer variables
{
int E_num = 0;//defining an integer variable E_num that holds a vlue 0
for (int i = 0; i < length; ++i)//declare for loop for row count
{
for (int j = 0; j < width; ++j)//declare for loop for column count
{
if(A[i][j]%2 == 0 )//use if block that check even number in array
{
E_num++;//incrementing the value of E_num
}
}
}
return E_num;//return E_num value
}
Explanation:
In the above code, a method "even" is defined, which accepts a 2D array "A" and two integers " length and width" in its parameter.
Inside the method, an integer variable "E_num" is defined that uses two for loop and an if block for the count the even numbers which are available on the 2D array.
please find the attahced file for method ouput.