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]
2 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]2 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
Click cell C6 in the Data worksheet and insert a column. Type Series Name in cell C6. Click cell C7 in the Data worksheet and in
Rudiy27

Answer:

right click cell C6 then insert entire column.

Type "Series Name"

Insert function to C7 = VLOOKUP (B7,$A$2:$B$4,2,FALSE)

Copy through C22

Select the range then select format and column width to change the width to 18.

7 0
3 years ago
In a Java Script language. create a two-dimension array consisting of numbers representing costs. After creating the array, prin
Tanzania [10]

Answer:

Can you elaborate more?

Explanation:

5 0
3 years ago
Compare the current in two lightbulbs wired in a series circuit
julia-pushkina [17]
<span>The current flow in two light bulbs wired in a series circuit is identica</span>
7 0
3 years ago
.true or false? one disadvantage of cloudware is that it is never free<br> A. true<br> B. false
ser-zykov [4K]

Answer:

true

Explanation:

cloudware is used for many reasons and It is sometimes too much of an expense to the company

7 0
2 years ago
1.The hardware that allows data to be transmitted from a computer along a telephone line to another computer at the other end is
valkas [14]

So this is called a modem we use it to send  and receive info over telephone lines

Hope this helps

-scav

4 0
2 years ago
Other questions:
  • How is informatics affecting banking and financial institutions?
    13·1 answer
  • Ned and mary ann are saving their files to a cd
    15·1 answer
  • Read the excerpt from The Code Book. Other attacks include the use of viruses and Trojan horses. Eve might design a virus that i
    13·1 answer
  • A text file has been transferred from a Windows system to a Unix system, leaving it with the wrong line termination. This mistak
    15·1 answer
  • Which of the following is most likely to be considered plagiarism? Using materials from a source without proper citation. Adding
    5·1 answer
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • I just wanna know how many times a day y'all hit the tutor button at the bottom
    10·2 answers
  • How should excel Identify social security numbers: as a text, numbers, or date and time? Why?
    11·2 answers
  • What does business informWhat does business information management do?
    12·1 answer
  • A message is sent to all hosts on a remote network. Which type of message is it?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!