Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What will be the output of following code? int [ ] [ ] twoDArray { 1 , 2 , 3 } , { 4 ,

What will be the output of following code?
int [][] twoDArray
{1,2,3},
{4,5,6},
{7,8,9}
};
int evensum =0;
for (int i=0; i twoDArray. length; i++){
for (int j=0;j twoDArray [i]. length; j++){
if (twoDArray[i][j]%2==0){
evenSum += twoDArray [i][j];
}
}
}
System.out.println("Sum of all even numbers: "+ evenSum);
Sum of all even numbers: 22
Sum of all even numbers: 18
Sum of all even numbers: 24
Sum of all even numbers: 20
AGU
What is the repeating pattern?
Assumption
Initial state: QAQBQCQDQE=00000
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Write formal proposal requests.

Answered: 1 week ago

Question

Write an effective news release.

Answered: 1 week ago

Question

Identify the different types of proposals.

Answered: 1 week ago