Answer to Question #192994 in C++ for VASANTH V

Question #192994

Develop a C++ program to use skipws flags which skips white space on input of three words


1
Expert's answer
2021-05-13T19:08:02-0400
/*C++ program to use skipws flags which skips white space on input of three 
  words
*/
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
    string userString, firstWord, secondWord, thirdWord;
    cout<<"Enter three words separated by white space: ";
    getline(cin, userString);
    istringstream iss(userString);
    iss>>skipws>>firstWord>>secondWord>>thirdWord;
    cout<<firstWord<<secondWord<<thirdWord;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog