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
Bezzdna [24]
3 years ago
11

how to write a function "void funct()" which will accept a string from the user as input and will then display the string backwa

rd.
Computers and Technology
1 answer:
Mariulka [41]3 years ago
5 0

Answer:

#include <bits/stdc++.h>

using namespace std;

void funct(){

   string name;

   cout<<"enter the string: ";

   cin>>name;

   

    reverse(name.begin(), name.end());

    cout<<"The string is : "<<name<<endl;

   

}

int main()

{

   funct();

 

  return 0;

}

Explanation:

create the function funct() with return type void and declare the variable type string and print a message for asking to used enter the string.  

The string enter by user is store in the variable using cin instruction.

after that, we use a inbuilt function reverse() which takes two argument.

firs argument tell the starting point and second index tell the ending point. then, the reverse function reverse the string.

name.begin() it is a function which return the pointer of first character of string.

name.end()  it is a function which return the pointer of last character of the string.

finally, print the reverse string.

for calling the function, we have to create the main function and then call the function.

You might be interested in
What is the difference between information poor and information rich<br>​
maw [93]

Answer:

The “Information poor” are consumers who use traditional mass media information such as television, DVDs, radios and magazines. ... On the opposite “information rich” stands for a new elite within the information society.

Explanation:

6 0
3 years ago
Choose the list of the best uses for word processing software.
coldgirl [10]
Microsoft Word is one that I can think of the top of my head.
5 0
4 years ago
If you need to set up direct deposit, which information from your check would you likely need?
scoray [572]
The bank routing number and checking account number will be needed.
5 0
3 years ago
What phobia is a fear of computers or working on a computer?
aleksandr82 [10.1K]
Cyberphobia is a fear of computers
7 0
3 years ago
Select all the correct answers.
Elden [556K]

Answer: Bulleted or numbered lists, presenting data in tables, and the formatting one.

Explanation: I’m taking the test and i’m pretty sure that’s right, lmk if you got a better answer though!

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which option will enable Mina to apply several formats to the spreadsheet cells at the same time? A. cell content B. cell patter
    13·1 answer
  • You are the system administrator for a medium-sized Active Directory domain. Currently, the environment supports many different
    7·1 answer
  • Operating systems such as Microsoft Windows use a specific character before a file extension to separate it from the filename. W
    9·2 answers
  • You are using a wireless client adapter with a site survey utility and a notebook computer to perform a manual site survey in a
    7·1 answer
  • A Unit of information containing the objects position, rotation, and scale values is called:
    13·1 answer
  • Which tool is best used to test an electrical current for a power source?
    8·1 answer
  • Page Up and Page Down keys fall under the ? keys category.
    14·2 answers
  • It is for employees to make mistakes that compromise the security of an organization’s computer devices and sensitive informatio
    10·2 answers
  • What are the advantages of using ICT jn our society?​
    8·2 answers
  • HELP PLEASE!!!!!!!!!<br> Please fix the coding! thanks I give brainliest
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!