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
Please help me please i’ll give brainli
DaniilM [7]
Answer: a digital bulletin board
4 0
3 years ago
Katherine wants to open a bank account that allowed her to perform frequent transactions without being charged a penalty and she
Pavlova-9 [17]

Answer:

C

Explanation:

8 0
3 years ago
A server core installation can't be converted to a minimal server interface.
11Alexandr11 [23.1K]
True.... ca i have brainliest?
3 0
3 years ago
Where would you go to change the macro settings in a Word document? Click the File tab and open Protection. Click the File tab a
yawa3891 [41]

Answer:

Click the File tab, select Options, and open the Trust Center.

Explanation:

7 0
3 years ago
True/False: A datasum can be generated for any width of data. For example, we can create an 8, 16, or 32 bit datasum for 8, 16,
Zolol [24]

Answer:

true

Explanation:

6 0
3 years ago
Other questions:
  • Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
    9·1 answer
  • Which of the following is NOT true about placement of the keyboard?
    6·1 answer
  • Write a Java method onlyDigits that takes a string as a parameter. The method should remove from the string all characters, whic
    15·1 answer
  • What does a column represent in a chart?
    13·1 answer
  • All windows on the desktop have width and height (as well as numerous other attributes). However the actual contents of the wind
    13·1 answer
  • Which shape denotes a process to be carried out in a flowchart?
    7·2 answers
  • What is the tallest dam in the united states of america?
    14·2 answers
  • Which two components help input data in a computer and select options from the screen, respectively?
    9·1 answer
  • Can someone please help me with 6.8 Code Practice adhesive.
    14·2 answers
  • Daily IT Question
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!