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
lozanna [386]
3 years ago
13

Write a function called reverse() with this prototype:

Computers and Technology
1 answer:
tresset_1 [31]3 years ago
4 0

Answer:

void reverse(char dest[], char source[], int size)

{

   for(int i=0;i<size;i++)//using for loop.

   {

       dest[i]=source[i];//assigning each element of source array to dest array.

   }

   int s=0,e=size-1;//initializing two elements s with 0 and e with size -1.

   while(s<e){

       char t=des[s];             //SWAPPING

       dest[s]=dest[e];            //SWAPPING

       dest[e]=t;                  //SWAPPING

       s++;

       e--;

   }

}

Explanation:

I have used while loop to reverse the array.I have initialize two integer variables s and e with 0 and size-1.Looping until s becomes greater than e.

It will work as follows:

first s=0 and e=0.

dest[0] will be swapped with dest[size-1]

then s=1 and e=size-2.

then des[1] will be swapped with dest[size-2]

and it will keep on going till s is less than e.

You might be interested in
Noi needs to send some documents to a client in another company. Which device can she use to make digital copies of the paper fi
soldier1979 [14.2K]
D scanner She can scan the files and email a digital copy.
4 0
3 years ago
Read 2 more answers
The "fathers of the internet" are vinton cerf and ________.
Harrizon [31]
Robert E Kahn I hope this helps
8 0
3 years ago
The
saveliy_v [14]
The answer is Undo I think
4 0
3 years ago
Read 2 more answers
You have been asked to implement a data integrity program to protect data files that need to be electronically downloaded by the
Katyanochek1 [597]

Answer:

SHA-1 is used in this case.

Explanation:

7 0
3 years ago
Which three features can be configured in the BIOS settings to secure a computer?
Vladimir79 [104]
Passwords, TPM, and Drive Encryption.

Hope this helps. :)
8 0
3 years ago
Other questions:
  • You want to register the domain name ABCcompany.org, but the registration service is not allowing you to do that. What's the mos
    10·1 answer
  • How is sharepoint used in organization today?
    12·1 answer
  • A url consists of a ____, a domain name, sometimes the path to a specific web page or location in a web page, and the web page n
    11·1 answer
  • If I make a Zoom Meeting, would you join it?
    7·2 answers
  • PLEASE HELP POWER POINT:
    8·2 answers
  • WHAT SO THESE THINGS THAT I'VE HIGHLIGHTED MEAN IN MICROSOFT WORD?
    12·1 answer
  • A store sells rope only in whole-foot increments. Given three lengths of rope, in feet, the following code segment is intended t
    13·2 answers
  • When you insert a photo into a document, its placed at the ​
    13·2 answers
  • Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyram
    6·2 answers
  • 5. An external CSS file is saved with D. Answer the following questions. 1. Explain the purpose and advantages of using CSS.​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!