Skip to content

swapTwoStringInC++ #910

@VenusYadav

Description

@VenusYadav

#include
#include
using namespace std;

int main() {
string str1;
string str2;
cin>>str1;
cin>>str2;

str1.swap(str2); 
cout<<str1<<"\n";
cout<<str2;

return 0;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions