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
juin [17]
3 years ago
6

Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the secon

d with the next to the last, and so on, all the way to the middle of the array. Given an array a and two other int variables, k and temp, write a loop that reverses the elements of the array. Do not use any other variables besides a, k, and temp.
Computers and Technology
1 answer:
Ksivusya [100]3 years ago
4 0

Answer:

// Assume that all variables a, n, temp have been declared.

 // Where a is the array, n is the array length, temp is a temporary

 // storage location.

 // Cycle through the array a.

 // By the time the loop gets halfway,

 // The array would have been reversed.

 // The loop needs not get to the end of the array.

 // Hence, the loop ends halfway into the array i.e n/2.

 for (int k = 0; k < n / 2; k++) {

   

  // Swap first and last, second and next-to-the-last and so on

  temp = a[k];

  a[k] = a[n - k - 1];

  a[n - k - 1] = temp;

 }

Explanation:

Carefully go through the comments in the code.

Hope this helps!

You might be interested in
Which career qualification is unique to the Energy Transmission career pathway and not to the Energy Distribution pathway? color
Sergeeva-Olga [200]

Answer:

a, c, d

Explanation:

6 0
3 years ago
Read 2 more answers
Since the 1960s, there have been five major generations, or cycles, of computing. Which represents those generations in order?
sergiy2304 [10]

Answer:a) Mainframes, miniframes, PCs, desktop Internet computing, mobile computing

Explanation: The hierarchy of the computers or computing are in the generation is:-

  • Mainframe:-designed for the execution of huge data processing , storage and execution.
  • Miniframe:-has similar functioning as the mainframe but on smaller scale and version.
  • Personal computer(PC):-It is designed for the individual purpose and according the need of the user.
  • Mobile computing:-computing that can be done on the mobile phone similar to the computing on the personal computer
  • Internet computing:-the computing of the mobile and computer system with the facility of the internet connectivity.

7 0
3 years ago
____ is the use of networking technology to provide medical information and services.
Cerrena [4.2K]
Answer: WebMD

WebMD, with the URL https://www.webmd.com, provides credible health and medical information on the web.
3 0
3 years ago
Maria's manager asked her to print a certain document for their meeting. It took her so long to find the file that she was late
Hoochie [10]

hey let me and sans help. . . . .hmmm. . .

sans said create a word-processing document that lists where she has saved files.

9 0
3 years ago
Read 2 more answers
Select ALL of the statements that are true:
Sati [7]

Answer:

a. Datums can be established through trigonometric leveling.

d. Geoid models have improved through time.

e. NGVD29 was matched to more tidal stations than NAVD88

Explanation:

a. Datums can be established leveling with trigonometric form, is a method to determinate different elevations.

d. Geoid models have been improved through time in the gravimetric geoid model and increase accuracy, actually, these models keep refining, there were errors ins this models, nowadays are more accurate.

e. NGVD29 was matched by tidal stations more than NAVD88.

NGVD29 was established by 26 tidal gauges in United Stated and Canada, maps were prepared, but NGVD29 was replaced because is less accurate than NAVD88.

NAVD88 were not used Additional tidal.

False sentence

b. The average sea level doesn't correspond to our current vertical data, this depends on our location.

For example

Rinconada in Peru is the highest human establishment in the world to 5100 m.

Everest is the highest summit in the world to 8848 m.

This marker indicating the sea level is located in Jerusalem.

c. Often is used levels, but there are other methods like set-up, bench mark.

f. the Dynamic heights are not the same as orthometric heights, because the dynamic heights are perfect, but the orthometric heights can change slightly, in a few words are imperfect heights.

6 0
3 years ago
Other questions:
  • &gt;&gt;&gt; import math &gt;&gt;&gt; print(math.Pi) 3.141592653589793 &gt;&gt;&gt; def print_volume(): print ("What is the radi
    12·1 answer
  • A structure that specifies which of a number of permitted data types (e.g. integers) that may be stored in its instances is:
    6·1 answer
  • Which property of a text element controls how the browser handles text that does not fit within the element box?
    13·1 answer
  • Which of the following is NOT one of the Big 3 Google Applications that we discussed?
    9·2 answers
  • What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible
    11·1 answer
  • Tara is creating a presentation for her science project about volcanoes. She added different animations to every slide for empha
    12·1 answer
  • This isn't really a question ,but a random fact about Fnaf William Aton
    7·2 answers
  • How to use access?<br> like working in access and bringing tables and stuff
    5·1 answer
  • I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right b
    14·1 answer
  • I need the full code for 6.1.3 code hs circles and squares please answer please help
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!