C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 21, Problem 21.20E
Program Plan Intro

Printing a String Backward

Program Plan:

  • Include the required header files.
  • Define the “main()” function
    • Create a string variable str.
    • Accept a line of text from user into str.
    • Display the original value of str variable.
    • Display the message “String in reverse order”.
    • Create a reverse_iteratorrit.
    • Using a loop, traverse it from the end of the string to the beginning of the string using the rbegin() andrend() functions.
    • Display each character of the string.

Blurred answer
Students have asked these similar questions
find a counterexample for the statement,
What is the difference between the statements continue and break?
Fill in the blanks to rewrite the following statement with variables: “Given any positive real number, there is a positive real number that is smaller.” (a) Given any positive real number r, there is _____________ s such that s is ___________ . (b) For any _________ , __________ such that s < r
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License