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
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
Science,
5 months ago
Accountancy,
5 months ago
Math,
11 months ago
Math,
1 year ago
Hindi,
1 year ago