ExamVeda
Login
Home
This question belongs to Java Program Array
Array
?

What will be the output of the following Java code?
class array_output 
{
    public static void main(String args[]) 
    {
        int array_variable[][] = {{ 1, 2, 3}, { 4 , 5, 6}, { 7, 8, 9}};
        int sum = 0;
        for (int i = 0; i < 3; ++i)
            for (int j = 0; j <  3 ; ++j)
                sum = sum + array_variable[i][j];
        System.out.print(sum / 5);
    } 
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.