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
If you create a column break, what happens to the text after the insertion point?
Ugo [173]

Answer:

It moves to the top of the next column.

5 0
3 years ago
What type of lens was used to take this picture?
Leona [35]

Fish-eye because this is how you would see through a "fish eye" point of view in a rounded tank that is commonly used.

May I please have brainliest

4 0
4 years ago
1. You are given a database to create, however, you realize that in the instructions you are told to create relationships betwee
Alik [6]

Answer:

In your table create statement, you can reference a primary key of another table. This is called a foreign key.

The syntax varies per database type.

6 0
3 years ago
Examine the exhibit above. Host B is sending an email intended for the user on Host A to the email server. What protocol is bein
Zolol [24]

Answer:

The correct answer to the following question will be "SMTP".

Explanation:

SMTP is indeed an encrypted communications-transmission interaction protocol.

  • It's also a pushing protocol that is used to deliver the package, while POP as well as IMAP is used to recover certain mails on the hand of the recipient.
  • Using this protocol, the messages or text is sent via the router.

So, it's the right answer.

8 0
4 years ago
Energy Drink Consumption A soft drink company recently surveyed 16,500 of its customers and found that approximately 15 percent
slamgirl [31]

Answer:

Follows are the code to this question:

#include <iostream>//header file

using namespace std;

int main()//defining a main method

{

int customer= 16508;//defining an integer variable

int E_drink, C_drink;//defining an integer variable

double buy_Energy_drink,buy_cold_drink;//defining a double variable

buy_Energy_drink= 0.15;//use double variable to assign value

buy_cold_drink= buy_Energy_drink *0.58;//use double variable to calculate value

E_drink = customer*buy_Energy_drink;//calculating value of E_drink

C_drink= customer*buy_cold_drink;//calculating value of E_drink

cout<<"\t\t\t -:Energy Drink Consumption:-"<<endl;//print message

cout<<"According to A soft drink company surveyed 16,500 of its customers."<<endl;//print message

cout<<E_drink <<" customer purchase one or more energy drinks per week."<<endl;//print message with value

cout<<C_drink <<" customer who prefer citrus-flavored energy drinks."<<endl;//print message with value

return 0;

}

Output:

Please find the attached file.

Explanation:

In this code, three integer variable "customer, E_drink, and C_drink" is defined, in which the first variable is used to hold a value, and the next two variables are used for calculating the value.

In the next step, two double variables "buy_Energy_drink, buy_cold_drink" is defined that calculate the given percentage value and passed into the integer variable to calculate the value and print the value with the given message.

5 0
3 years ago
Other questions:
  • If you want a user to enter exactly 20 values which loop would be the best to use
    12·1 answer
  • When a file has been opened using the 'r' mode specifier, which method will return the file's contents as a string??
    12·1 answer
  • What are the high and low temperatures on Saturn? (C)
    11·1 answer
  • Gretchen has just started making a new presentation in a series of PowerPoint presentations. The default formatting for text in
    12·1 answer
  • _An electronic device used for processing data.
    10·2 answers
  • Al these are benefits of computer literacy except
    14·1 answer
  • As you continue to build the help desk, you want to ensure that all of the tools are in place and that the analysts have the too
    15·1 answer
  • Which work habits should you follow to increase work efficiency and avoid health issues?
    6·1 answer
  • Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
    8·1 answer
  • Hue purchased 50 shares of stock on April 24, 2019. The price skyrocketed, so she decided to sell the stock in April of 2020. Wh
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!