EBK C HOW TO PROGRAM
EBK C HOW TO PROGRAM
8th Edition
ISBN: 9780133964639
Author: Deitel
Publisher: PEARSON CUSTOM PUB.(CONSIGNMENT)
Question
Book Icon
Chapter 6, Problem 6.36RE
Program Plan Intro

Program Plan-

  • Include the header files and initialize the main() function.
  • Prompt the user to take the input of character array.
  • To define the recursive function stringReverse (char []) that takes character array as inputto reverse it.
  • Call the function to display the output.
  • Define the function role in the respective function definition.

Summary Introduction- The program prints the character array in reverse order.

Program Description- The purpose of the program is to take the character array as input and print it in reverse order using the following recursive function and returns nothing.

voidstringReverse (char [])

Blurred answer
Students have asked these similar questions
(Recursive Greatest Common Divisor) The greatest common divisor of integers x and y isthe largest integer that evenly divides both x and y. Write a recursive function gcd that returns thegreatest common divisor of x and y. The gcd of x and y is defined recursively as follows: If y is equalto 0, then gcd(x, y) is x; otherwise gcd(x, y) is gcd(y, x % y), where % is the remainder operator.
(Replace strings) Write the following function that replaces the occurrence of a substring old_substring with a new substring new_substring in the string s. The function returns true if string s is changed, and otherwise, it returns false. bool replace_strings (string& s, const string& old_string, const string& new_string) Write a test program that prompts the user to enter three strings, i.e., s, old string, and new_string, and display the replaced string.
(Compute greatest common divisor using recursion) The gcd(m, n) can also be defined recursively as follows: If m % n is 0, gcd (m, n) is n. Otherwise, gcd(m, n) is gcd(n, m % n). Write a recursive function to find the GCD. Write a test program that prompts the user to enter two integers and displays their GCD.

Chapter 6 Solutions

EBK C HOW TO PROGRAM

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning