Question: what is the output of this program? public class array_output { public static void main(String args[]) { int array_variable[][] = {{ 1, 2}, { 4

  1. what is the output of this program?

publicclassarray_output

{

publicstaticvoidmain(String args[])

{

intarray_variable[][] = {{ 1, 2}, { 4 , 6}, { 7, 8}};

intsum = 0;

for(inti = 0; i < 3; ++i)

for(intj = 0; j < 2 ; ++j)

sum = sum + array_variable[i][j];

System.out.print(sum / 2);

}

}

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 Programming Questions!