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 Python function that takes as input a list, A, and returns two lists L and G. L constains all numbers in A, which are no
DiKsa [7]

Answer:

In Python:

def split(A):

   L=[]; G=[]

   for i in range(1,len(A)):

       if (A[i] != A[0] and A[i] < A[0]):

           L.append(A[i])

       if (A[i] != A[0] and A[i] > A[0]):

           G.append(A[i])

   return L, G

Explanation:

This defines the function

def split(A):

This initializes the L and G lists

   L=[]; G=[]

This iterates through the original list A

   for i in range(1,len(A)):

This populates list L using the stated condition

<em>        if (A[i] != A[0] and A[i] < A[0]):</em>

<em>            L.append(A[i])</em>

This populates list G using the stated condition

<em>        if (A[i] != A[0] and A[i] > A[0]):</em>

<em>            G.append(A[i])</em>

This returns the two lists L and G

   return L, G

8 0
2 years ago
OSI layer for HDLC??​
tresset_1 [31]

Answer:

HDLC is one of the most commonly used internet protocols (IP) in what is Layer 2 of the industry communication reference model called Open Systems Interconnection (OSI).

Explanation:

3 0
3 years ago
Directory services store information in a heirarchical structure. Which statements about Organizational Units (OUs) of a directo
NeX [460]

Answer:B

Explanation:

Specific files within an OUs or container are called object.

5 0
3 years ago
Who is the first computer programmer​
enot [183]

Answer:

Ada Lovelace was the first computer programmer

8 0
2 years ago
Read 2 more answers
Your employer's right to electronically monitor you is an issue of ____.
Cloud [144]

Answer: Employee privacy

Explanation:

 Employers can electronically monitor property, computer and electronic devices under the their rights in the organization but there is issue of employee privacy. As, employee has the right to privacy in the organization or workplace.

In some organization phones and email address are provided by the company so that they can electronically monitor the employee properly. In this case, some employee feel that monitoring is the violation of their personal  and privacy rights.

8 0
2 years ago
Other questions:
  • Which is a benefit of peer-to-peer networking?
    10·1 answer
  • Choose the false statement below. The content that displays in the browser is contained in the head section. The content that di
    14·1 answer
  • Consider a satellite orbiting the earth. Its position above the earth is specified in polar coordinates. Find a model-view matri
    12·1 answer
  • What is the process of attaching gage blocks to each other
    7·1 answer
  • The ______ printers are the most popular type of printer in small office/home office and large office environments.
    5·1 answer
  • If you were required to give a speech identifying the risks of using computers and digital devices, which group of items would y
    7·1 answer
  • What is the difference between RELIABLE and UNRELIABLE sources of<br> income?
    7·2 answers
  • Write a pseudocode to calculate the volume of a cylinder​
    12·1 answer
  • What are five types of applications you can create in Visual Basic 2017?
    12·2 answers
  • which filename refers to a 16-bit real-mode program that queries the system for device and configuration data, and then passes i
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!