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]
3 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]3 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
If a document is stored on a file server but team members can edit the document​ anonymously, the content on the file server is:
gogolik [260]

Answer:

d

Explanation:

Because a decimal number

3 0
3 years ago
Which type of error is a random error
zlopas [31]

Answer:

statistical fluctuations

Explanation:

8 0
3 years ago
Read 2 more answers
When there are items that are out of the control of the programmer that may support or oppose the program goals, this is termed
netineya [11]

Answer:

Option D (External influences) is the correct choice.

Explanation:

  • External factors including certain regulatory changes, the economy, globalization as well as new technologies may determine the effectiveness of such smaller businesses.
  • They are the be the variables that may be out of a corporation's influence. While a company has no power regarding external factors, these factors may have a direct effect on the company.

Other given choices are not related to the given circumstances. So that option D would be the right one.

3 0
4 years ago
Crashing almost always accelerates the schedule while increasing project risk, whereas fast tracking almost always accelerates t
Ivahew [28]

Answer: False

Explanation: Because fast-tracking doesn’t involve additional resources, it’s usually best to start with this technique while Crashing requires careful planning to prevent “panic mode” among the project crews and to avoid acceleration claims.

4 0
3 years ago
__________ was the first operating system to integrate security as its core functions.
Mrrafil [7]
Multics was the first operating system to integrate security as its core functions.
7 0
3 years ago
Read 2 more answers
Other questions:
  • When you set the position property for a block element to fixed, the element
    5·1 answer
  • Garry is a record executive who is building a data table to include in a presentation about one of his artists. The table is mea
    15·1 answer
  • What is the different between ethical and legal issues?​
    6·1 answer
  • Which of the following is a correct group scope type in AD, windows server 2016?
    6·1 answer
  • Why must a mobile application be easily customized and personalized?
    14·2 answers
  • Brainliest for correct answer
    13·2 answers
  • Having sound enhances your App, do you agree with this? Explain.
    9·1 answer
  • I WILL MARK IT BRAINLIEST FOR SURE ☺️❤️
    13·1 answer
  • What is the full form of MOS<br>​
    10·1 answer
  • The original programs awaiting tanslation is called​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!