adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <string>
    #include <algorithm>
    using namespace std;
    int main() 
    {
        string s = "spaces in text";
        s.erase(remove(s.begin(), s.end(), ' ' ), s.end() ) ;
        cout << s << endl;
    }

a.

spaces

b.

spaces in

c.

spaces in text

d.

spacesintext

Answer: (d).spacesintext

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?