Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a program in C++ that uses the following function. This function takes a string as an input parameter and returns a string that

image text in transcribed
1. Write a program in C++ that uses the following function. This function takes a string as an input parameter and returns a string that is the reverse of the provided string. The function signature is as follows: string reverseString(string test) An output of the program is as follows: fali@fali-virtual-machine:-/cts234/labs $. /lab5a Please enter a string :123456789 abcd Reverse string is dcba 987654321 fali@fali-virtual-machine:-/cis234/labs $ 2. Write a program in C that uses the following function. This function takes three arguments. One is the pointer to user string, second is the pointer to store the reverse string, and third is an integer that has the value of user string length. In this program we will not enter a string with spaces. void reverseString (char* usrStr, char* revStr,int len) An output of the program is as follows: faliefali-virtual-machine: /cis234/lab \$ ./lab5a Please enter a string :98765432 reverse of 98765432 is 23456789 faliefali-virtual-machine:-/cts38/les $ 3. Write a function in C and C++ that takes a 4 digit integer (not four separate integers) and returns a 4 digit number that is reverse of the entered number. Use that function in a program. Function signature is as follows and it will be same for both C and C++. int reverse(int num) follows

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions