Computer Science, asked by Anonymous, 11 months ago

Write a Program to extract all the letters in a word and display all the letters in different lines in the same order.

Answers

Answered by 217him217
1

Answer:

#include<bits/stdc++.h>

using namespace std;

void printWords(string str)

{

// word variable to store word

string word;

// making a string stream

stringstream iss(str);

// Read and print each word.

while (iss >> word)

cout << word << endl;

}

// Driver code

int main()

{

string s = "sky is blue";

printWords(s);

return 0;

}

Similar questions