Example 1 #include using namespace std; int main(){ string x, y; cout<<"Enter x: "; getline(cin,x); cout<<"Enter y: "; cin>>y; cout<<"x= "<< x <<", y="< using namespace std; int main() { string myStr = "This is a sample string"; cout << "length() function: " << myStr.length() < using namespace std; int main() { string x, y; cout << "Enter x: "; getline(cin,x); cout << "Enter y: "; getline(cin, y); if(x==y) cout<<"x and y are equal"<y) cout << "x is alphabetically after y" << endl; return 0; } Example 4 #include using namespace std; int main() { string x = "Information and "; string y = "Communication Technology"; string z; z = x + y; cout << z << endl; return 0; }