πŸ“Š JAVA
Q. 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);
}
}
  • (A) 8
  • (B) 9
  • (C) 10
  • (D) 11
πŸ’¬ Discuss
βœ… Correct Answer: (B) 9

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
77
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
86%
Success Rate