subject

In the code segment below, assume that the int array numArr has been properly declared and initialized. The code segment is intended to reverse the order of the elements in numArr. For example, if numArr initially contains {1, 3, 5, 7, 9}, it should contain {9, 7, 5, 3, 1} after the code segment executes. /* missing loop header */
{
int temp = numArr[k];
numArr[k] = numArr[numArr. length - k - 1];
numArr[numArr. length - k - 1] = temp;
}
Which of the following can be used to replace /* missing loop header */ so that the code segment works as intended?
a. for (int k = 0; k < numArr. length / 2; k++).
b. for (int k = 0; k < numArr. length; k++).
c. for (int k = 0; k < numArr. length / 2; k--).
d. for (int k = numArr. length - 1; k >= 0; k--).
e. for (int k = numArr. length - 1; k >= 0; k++).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:50
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria.what am i?
Answers: 2
question
Computers and Technology, 24.06.2019 17:50
You will subnet the network address 172.31.103.0/24. the network has the following requirements: · room-114 lan will require 27 host ip addresses · room-279 lan will require 25 host ip addresses · room-312 lan will require 14 host ip addresses · room-407 lan will require 8 host ip addresses how many subnets are needed in the network topology?
Answers: 2
question
Computers and Technology, 25.06.2019 00:00
When pasting an existing chart into a word document, you can choose to using the paste options button. a. paste the chart as a picture b. embed the chart c. add the chart while keeping the destination formatting intact d. insert the chart while keeping the source formatting intact
Answers: 1
question
Computers and Technology, 25.06.2019 08:50
Write multiple if statements: if caryear is before 1968, print "probably has few safety features." (without quotes). if after 1971, print "probably has seat belts.". if after 1991, print "probably has anti-lock brakes.". if after 2002, print "probably has airbags.". end each phrase with period and newline. ex: caryear = 1995 prints:
Answers: 2
You know the right answer?
In the code segment below, assume that the int array numArr has been properly declared and initializ...
Questions
question
Mathematics, 14.12.2019 00:31
question
Mathematics, 14.12.2019 00:31
Questions on the website: 13722367