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
omeli [17]
4 years ago
14

Write a method named swapAll that accepts two arrays of integers as parameters and swaps their entire contents. You may assume t

hat the arrays passed are not null and are the same length. For example, if the following arrays are passed:int[] a1 = {11, 42, -5, 27, 0, 89};
int[] a2 = {10, 20, 30, 40, 50, 60};
Computers and Technology
1 answer:
vodomira [7]4 years ago
7 0

Answer:

void swapAll(int *a1, int *a2, int n){

int i;

int tmp[n];

for(i = 0; i < n; i++){

tmp[i] = a1[i];

a1[i] = a2[i];

a2[i] = tmp[i];

}

}

Explanation:

You just need a temporary structure.

I am going to write a c script, in which a1 and a2 are the arrays and n is the length of the arrays.

void swapAll(int *a1, int *a2, int n){

int i;

int tmp[n];

for(i = 0; i < n; i++){

tmp[i] = a1[i];

a1[i] = a2[i];

a2[i] = tmp[i];

}

}

You might be interested in
Chapter
vichka [17]

Answer:

Seatbelt

Explanation:

The seatbelt allows everyone in the car to remain safe and steady going at certain high miles per hour. None of the other options were made for safety only. Please name brainliest!!!

4 0
3 years ago
1. of the following individuals, who was the most recent to develop information searching tools online? (points : 1) otlet wells
alexdok [17]
I think the correct answer from the choices listed above is the third option. Of the individuals listed, the one who recently develop <span> information searching tools online is Bush. Hope this answers the question. Have a nice day. Please feel free to ask more questions.</span>
3 0
3 years ago
This is your code.
guapka [62]

Answer:

35

Explanation:

List E is a 2 dimensional array. We want index 1 of E, which is B. Now we have an index of that list B, it is index 0 so 35.

7 0
3 years ago
Is USA TestPrep a test-taking site that won't let you access other windows without kicking you off?
olga_2 [115]

Answer:

usatestprep literally just does what the name says; it prepares you for tests in america. it doesn't kick you off if you access other windows

Explanation:

3 0
4 years ago
Which of the following is an example of a database?
Katyanochek1 [597]
I think it’s A or D hope that helps
6 0
3 years ago
Read 2 more answers
Other questions:
  • When saving a document or drawing, you determine the destination folder in which the file will be saved by?
    6·1 answer
  • When an error occurs during the execution of a method, the method ____________ an exception?
    11·1 answer
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • The work day has just started and you receive reports that the inventory management server is not accessible on your company's n
    7·1 answer
  • What is a programming language?
    11·2 answers
  • 2. Use the Internet to research Robocopy switches and then construct a command line that will use Robocopy to copy files in rest
    14·1 answer
  • Another name for the office button menu is the toolbar. true or false.
    7·2 answers
  • In the following code, use a lock to protect any data that might need protecting. Keep your critical sections as small as possib
    8·1 answer
  • Pen registers and trap-and-trace devices are not considered forms of searches and do not need probable cause and a court order b
    10·1 answer
  • Which of the following jobs usually requires some level of formal higher education other than vocational training?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!