?
What does the following piece of code do?
What does the following piece of code do?
for(int i = 0; i < row; i++)
{
for(int j = 0; j < column; j++)
{
if(i == j)
sum = sum + (array[i][j]);
}
}
System.out.println(sum);
for(int i = 0; i < row; i++)
{
for(int j = 0; j < column; j++)
{
if(i == j)
sum = sum + (array[i][j]);
}
}
System.out.println(sum);
Join the Discussion
Login to post a comment or share your explanation.
Login