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
Naddik [55]
2 years ago
12

Write a function to reverse a given string. The parameter to the function is a string. Function should store the reverse of the

given string in the same string array that was passed as parameter. Note you cannot use any other array or string. You are allowed to use a temporary character variable. Define the header of the function properly. The calling function (in main()) expects the argument to the reverse function will contain the reverse of the string after the reverse function is executed.
Computers and Technology
1 answer:
babymother [125]2 years ago
6 0

Answer:

Following are the program to this question:

#include <iostream> //defining header file

using namespace std;

void reverse (string a) //defining method reverse  

{

for (int i=a.length()-1; i>=0; i--)  //defining loop that reverse string value  

 {

     cout << a[i];  //print reverse value

 }

}

int main() //defining main method                                                                                          

{

string name; // defining string variable

cout << "Enter any value: "; //print message

getline(cin, name); //input value by using getline method

reverse(name); //calling reverse method

return 0;

}

Output:

Enter any value: ABCD

DCBA

Explanation:

In the above program code, a reverse method is declared, that accepts a string variable "a" in its arguments, inside the method a for loop is declared, that uses an integer variable "i", in which it counts string value length by using length method and reverse string value, and prints its value.

  • In the main method, a string variable "name" is declared, which uses the getline method.
  • This method is the inbuilt method, which is used to input value from the user, and in this, we pass the input value in the reverse method and call it.  
You might be interested in
While you work on the customer's printer, he continues chatting about his network and problems he's been experiencing. One compl
Tanya [424]

Answer:

Most likely a serial cable. The type of cable is dependent on the WAN port, we can have serial or CAT 6 cable.

Explanation:

8 0
3 years ago
A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large compu
Taya2010 [7]
I think it'd be terminal concentrator.  A(n) terminal concentrator is a front - end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large computer. 
7 0
3 years ago
Hexadecimal to denary gcse method
Anuta_ua [19.1K]

There are two ways to convert from hexadecimal to denary gcse method. They are:

  • Conversion from hex to denary via binary.
  • The use of base 16 place-value columns.

<h3>How is the conversion done?</h3>

In Conversion from hex to denary via binary:

One has to Separate the hex digits to be able to know or find its equivalent in binary, and then the person will then put them back together.

Example - Find out the denary value of hex value 2D.

It will be:

2 = 0010

D = 1101

Put them them together and then you will have:

00101101

Which is known to be:

0 *128 + 0 * 64 + 1 *32 + 0 * 16 + 1 *8 + 1 *4 + 0 *2 + 1 *1

= 45 in denary form.

Learn more about hexadecimal from

brainly.com/question/11109762

#SPJ1

3 0
2 years ago
Which utility would you use to test communication on your own computer using your ip address as a parameter?
olganol [36]
Ping and traceroute locally and on a remote server. Locally it will tell if you local setup is correct and to test your network communication it needs to travel over a network.
5 0
3 years ago
How acid rain pollution will affect the food chain
babunello [35]

Explanation:

Acid rain can cause serious problems for many different animals and plants. As a result, the entire food web is affected. For example, acid rain can cause phytoplankton in lakes to die. Insects, which rely on phytoplankton for food, now have less food to eat, and they begin to die as a result.

3 0
3 years ago
Read 2 more answers
Other questions:
  • What are the advantages and disadvantages to a home user of replacing dial-up Internet access with broadband?
    15·1 answer
  • Describe three main types of testing and the order in which they are performed.
    9·2 answers
  • Hen using presentation software, what do you do when you "compose a slide"?
    5·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • PLEASE HELP ME ANSWER AS MUCH AS YOU CAN I ONLY HAVE 3 POINTS LEFT AND IM TIMED. PLEASE TELL ME THE NUMBER AND LETTER. THANK YOU
    5·1 answer
  • Which statement is NOT a rule for the data source for the mail merge?
    13·2 answers
  • Abby wants to simply share a snapshot of her calendar with another user. Which option should she choose to achieve
    15·1 answer
  • Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a
    10·1 answer
  • Pls say correct guyz pls pls pls
    7·1 answer
  • Which element of the MakeCode Arcade interface represents an individual
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!