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
.Although SQL is a language, you don’t use it to write applications? (true, false)
Olin [163]

Answer:

The correct answer for the given question is true .

Explanation:

SQL is an Structural query language that is used for accessing the database basically it is an query language which is used for communicating with database by executed the query .

The following are the function of SQL  

SQL can insert the data into database

it can update the record into database

SQL can retrived the database.

We do not use SQL for writing application it is only used to accessing the database  

For create application we can use programming language Like PHP,ASP,JAVA ,PYTHON.etc.

3 0
3 years ago
Anyone wanna join my giggl?
Leni [432]

Answer:

whats a giggl

Explanation:

7 0
2 years ago
Read 2 more answers
I don't know how to explain what is motion in my own words
marusya05 [52]
Motion is the movement of a body part or an object
8 0
3 years ago
Read 2 more answers
1. A truck leaves a stop sign and accelerates uniformly over a time of 5.21 seconds for a
Rufina [12.5K]

Answer:

1, is 21.11 meters per second.

110/5.21

Explanation:

3 0
3 years ago
Multiply each element in origList with the corresponding value in offsetAmount. Print each product followed by a semicolon (no s
oee [108]

Answer:

Replace /* Your code goes here */  with

for(i =0; i<NUM_VALS; i++) {

    printf("%d", origList[i]*offsetAmount[i]);

printf(";");

}

Explanation:

The first line is an iteration statement iterates from 0 till the last element in origList and offsetAmount

for(i =0; i<NUM_VALS; i++) {

This line calculates and print the product of element in origList and its corresponding element in offsetAmount

    printf("%d", origList[i]*offsetAmount[i]);

This line prints a semicolon after the product has been calculated and printed

printf(";");

Iteration ends here

}

5 0
2 years ago
Other questions:
  • What is the role of the constructor for an object?
    5·1 answer
  • What environmental concern will hybrid cars address?
    6·2 answers
  • Data that are collected on large populations of individuals and stored in databases are referred to as _____.
    15·1 answer
  • A______ is a graphical representation of numeric data.
    8·1 answer
  • jeff wants to create a website with interactive and dynamic content. Which programming language will he use?
    11·2 answers
  • Which option is used to ensure the integrity and authenticity of a Word document but requires additional services to be availabl
    5·2 answers
  • Select the correct answer.
    5·1 answer
  • What does ATM mean on lego mario mean I know that this is not school related but I trying to help my brother ​
    5·1 answer
  • What is the main coding language for netflix?
    14·2 answers
  • A field value is currently not in any group. what happens when you try adding it to an existing group?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!