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
Write a script that will read from a file x and y data points in thefollowing format:
worty [1.4K]

Answer /Explanation

load hw92.dat

FID = fopen(file, 'r');

if FID == -1  

   fprintf('ERROR CANNOT OPEN FILE TO READ!');  

else

   fclose(file);

The we have:

datacell = textscan(FID, 'x%fy%f', 'CollectData', 1);

xycoords = datacell{1};

x 0 y 1

x 1.3 y 2.2

x 2.2 y 6

x 3.4 y 7.4

x 4.2 y 5.5

x 4.4 y 4.5

x 6.2 y 7.8

x 7.7 y 11.1

x 8.2 y 11.5

x 9.9 y 15.2

x 7.2 y 9.5

x 8.9 y 12.5

end

8 0
3 years ago
How do you change a account on an iPod generation 5
Ksenya-84 [330]
You have to hook it up to a computer, access iTunes and wipe it in settings so you can put in new account info
4 0
3 years ago
Numbering exception conditions, which often uses hierarchical numbering, in a fully developed use case description is helpful to
Vesna [10]

Answer:

a) tie the exception condition to a processing step

Explanation:

Numbering exception conditions, in a fully developed use case description is helpful to tie the exception condition to a processing step

The fully developed use case description is useful for the documentation of the context, purpose, description, conditions, and workflow of each use case. Activity diagrams give a graphical image of the use case workflow and serve the purpose of illustrating the alternative paths through a business process.

7 0
3 years ago
Which tool is used to view stars in galaxies far from the Milky Way?
Rom4ik [11]
<span>The tool iused to view stars in galaxies far from the Milky Way is the B. Hubble Space Telescope. This telescope is one of the largest telescopes to be launched in space, and has contributed a vast amount of discoveries and data that are valuable in astronomical research. The telescope is able to capture image intense high-resolution images, capturing entities from large distances.</span>
7 0
3 years ago
An internal conflict is generally harder to write and still harder to convey in an interactive computer game
Tanya [424]
True, because of how the human mind works, you could have a fairly hard decision that could affect your life. So, An Internal conflict is more difficult to convey in an interactive computer game.
7 0
3 years ago
Other questions:
  • Why is the answer A?
    6·1 answer
  • Which actions should be taken so that transitions proceed automatically? Check all that apply.
    12·2 answers
  • A powerful computer that acts as a hub for other computers is a called a ______.
    6·2 answers
  • 50 points!!!!!
    9·2 answers
  • Traditional methods of business communication tend to mean paper-based messages such as formal letters, brochures, reports, prop
    10·1 answer
  • Which of the following is NOT contained on the Slide Show toolbar?
    11·2 answers
  • Ethical design refers to...
    13·1 answer
  • PLEASE HURRY!!!!
    8·2 answers
  • In the year, , the American Department of Defense put a military research network, called ARPANET online.
    5·1 answer
  • A document commonly used in real estate transactions, detailing the fees, commissions, insurance, etc. that must be transacted f
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!