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
Which of the following best explains how algorithms that run on a computer can be used to solve problems?
timama [110]

The statement which best explains how algorithms running on a computer can be used to solve problems is; D. Some problems cannot be solved by an algorithm.

<h3>What is an algorithm?</h3>

An algorithm is simply a standard formula or procedures which is made up of a set of finite steps and instructions that must be executed on a computer, so as to proffer solutions to a problem or solve a problem under appropriate conditions.

However, it should be noted that it is not all problems that can be solved by an algorithm, especially because the required parameters and appropriate conditions are not feasible or met.

Read more on algorithm here: brainly.com/question/24793921

7 0
2 years ago
How many responses does a computer expect to receive when it broadcasts an ARP request?why?
Alla [95]

Answer: The response that is expected when it broadcast an ARP request is one or zero.

Explanation: ARP request means Address Resolution Protocol which is a protocol responsible for the mapping of the IP(Internet protocol)address of a system to the MAC(Media Access Control) layer. Only one response is received only if the IP address is present in the ARP otherwise if the IP address does not matches then no response is returned.Thus only one or zero response can be received when a ARP request is process.

5 0
2 years ago
What are smart mobile devices?
Mashutka [201]
Do you mean like a phone

IPhones
Samsung
Moto z
Lge sorry if this isn't what you asked
7 0
3 years ago
Read 2 more answers
1. what is the purpose of giving an id to an html element when using javascript?
bazaltina [42]

Answer:

It is also used by JavaScript to access and manipulate the element with the specific id.

3 0
2 years ago
Some scientists say that robots my become self - aware in the near future Do you think this is possible?​
galben [10]

Answer:

i believe that robots could become self aware because its called artificial intelligence, and that means that they can pretty much think for themselves

Explanation:

its just my opinion but i hope i helped!

6 0
2 years ago
Other questions:
  • Traditional methods of business communication tend to mean paper-based messages such as formal letters, brochures, reports, prop
    10·1 answer
  • _____ _____ deals with the definitions properties of mathematical models of computation.
    8·1 answer
  • Read first a user's given name followed by the user's age from standard input. Then use an ofstream object named outdata to writ
    6·1 answer
  • What does the action tool allow you to do in Microsoft power point?
    9·1 answer
  • A(n) _____ is a request for the database management software to search the database for data that match criteria specified by th
    15·2 answers
  • Which of the following is the definition of registration authority ( RA)?
    10·1 answer
  • Deb needs to add borders on the cells and around the table she has inserted into her Word document.
    7·1 answer
  • Procedural programs specify instructions that a processor must execute to perform computations. These programs sometimes consist
    11·1 answer
  • What do you mean by HDML coding ​
    13·1 answer
  • The most important preinstalled software is the ______ software that allows you to use the computer the first time you turn it o
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!