Question: Consider the following code segment. int [ ] [ ] multi = new int [ 4 ] [ 4 ] ; for ( int rows

Consider the following code segment.
int[][] multi = new int[4][4];
for (int rows =0; rows <4; rows++)
{
for (int cols =0; cols <4; cols++)
{
if (cols ==0)
{
multi[rows][cols]=0;
}
else if (cols ==1)
{
multi[rows][cols]=1;
}
else if (cols ==2)
{
multi[rows][cols]=2;
}
if ((rows %2==0) && (cols %2==0))
{
if ((rows >=2) && (cols <=2))
{
multi[rows][cols]=9;
}
}
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!