int result1 = result2 = a[0][0];
for(int i = 0; i< 3; i++)
{
for(int j = 0; j < 4; j++)
{
if(a[i][j] > result1)
{
result1 = a[i][j];
}
else if(a[i][j] < result2)
{
result2 = a[i][j];
}
}
}