Course Solutions Uncategorized (Solved) : 1 Design Write Program Accept Sentence Input Reverse Words Print Sentence Backwards Ex Mov Q26621242 . . . .

(Solved) : 1 Design Write Program Accept Sentence Input Reverse Words Print Sentence Backwards Ex Mov Q26621242 . . . .

 

/*1. Design and write a program that will accept a
sentence as input, reverse the words and print the
sentence out backwards. Ex: The movie was not very true to thebook.
Output: book the to true very not was movie The
(NOTE: You may keep the period after book if you want to.)*/

#include “stdafx.h”
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int main(void)
{
   string sentence;
   string ecnetnes;
   string part = “”;
   char letter;
   int length = 0, position = 0, i = 0;

   cout << “Enter sentence:” <<endl;
   getline(cin, sentence);

   position = sentence.length() – 1; // Set positionto last character.

   while (position >= 0)
   {
       letter

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post