1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elenna [48]
3 years ago
8

Which code snippet calculates the sum of all the even elements in an array values? Group of answer choices int sum = 0; for (int

i = 0; i < values.length; i++) { if ((values[i] % 2) == 0) { sum++; } } int sum = 0; for (int i = 0; i < values.length; i++) { if ((values[i] % 2) == 0) { sum += values[i]; } } int sum = 0; for (int i = 0; i < values.length; i++) { if ((values[i] / 2) == 0) { sum++; } } int sum = 0; for (int i = 0; i < values.length; i++) { if ((values[i] / 2) == 0) { sum += values[i]; } }
Computers and Technology
1 answer:
olganol [36]3 years ago
5 0

Answer:

The second one:

int sum = 0; for (int i = 0; i < values.length; i++) { if ((values[i] % 2) == 0) { sum += values[i]; } }

You might be interested in
Give 3 reasons why it is believed that smart phones precent us from communicating face to face.give three reasons why it is beli
gregori [183]

Answer:

yes

Explanation:

because the people will be lazy to go and talk to that person instead They will call each other and discuss

7 0
1 year ago
What is the first structure of a pascal program?
lapo4ka [179]

A Pascal program basically consists of the following parts :

Program name, uses command, type declarations, constant declarations, variables declarations, functions declarations, procedures declarations, main program block, statements and Expressions within each block, and comments

6 0
3 years ago
Computer are most wonderful creation of 21st century how ?​
son4ous [18]

Answer:

It can do all the functions at a speedy rate and also helps us to search and progress in our homes and businesses. A computer can therefore be called a calculator with a twist for not only does it perform fast calculations, but it also has other special characteristics.

Explanation:

hope it helps you

6 0
2 years ago
What keyword can we use within a form to pass it as an argument to a JavaScript snippet? A. form B. onSubmit C. send D. this
astraxan [27]

C. send is your answer

3 0
2 years ago
Read 2 more answers
Which of the following method calls are legal?a. mathMethod(x);b. mathMethod(y);c. mathMethod(x, y);d. mathMethod(x + y);e. math
Roman55 [17]

Answer:

Option a, b, d, f, and j is legal method calls.

Explanation:

In the given question some information is missing, that is the method definition which can be described as follows:

Method definition:

int x =2, y=3; //defining integer variable

int mathMethod (int x)  //method definition

{//method body

int z=x+y; //calculate value

return z;  //return value

}

In the given question option a, b, d, f, and j  is legal, because these options follow the correct syntax, and other option were incorrect which can be defined as follows:

  • In option c, It is illegal because it accepts only one parameter.
  • In option e, It is accepts long number, that's why it is illegal.
  • In option g, It accepts float value, that's why it is illegal.
  • In option h, It doesn't accepts any parameter.
  • In option i, It isn't use in method.
7 0
3 years ago
Other questions:
  • "Which of the following will help protect against a brute force attack?
    11·1 answer
  • Can I change my brainly username?
    9·2 answers
  • What education and training is required to be an applications software engineer?
    9·1 answer
  • Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string
    8·1 answer
  • In an AND truth table.
    7·1 answer
  • Which is an example of Raw Input?
    11·1 answer
  • In the ADT graph the methid addVertex has efficiency
    15·1 answer
  • Select the correct answer.
    12·2 answers
  • 6.4 Predicting Prices of Used Cars. The file ToyotaCorolla.csv contains data on used cars (Toyota Corolla) on sale during late s
    5·1 answer
  • Which of the selections below represents a recursive query?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!