Java To CPP Programs Strings
Java To CPP Programs Strings
int main() {
string st1, st2;
cout << "Enter the first string: ";
getline(cin, st1);
cout << "Enter the second string: ";
getline(cin, st2);
if (isAnagram(st1, st2))
cout << "Given words are anagram" << endl;
else
cout << "Given words are not anagram" << endl;
return 0;
}
int main() {
string str;
cout << "Enter the string: ";
getline(cin, str);
transform(str.begin(), str.end(), str.begin(), ::tolower);
Page 1
Java to C++ Converted Programs - Strings
return 0;
}
int main() {
string st1, st2;
int index;
cout << "Enter the First String: ";
cin >> st1;
cout << "Enter the Index: ";
cin >> index;
cout << "Enter the Second String: ";
cin >> st2;
cout << addString(st1, st2, index) << endl;
return 0;
}
Page 2
Java to C++ Converted Programs - Strings
int main() {
string st;
cout << "Enter the string: ";
cin >> st;
if (isPalindrome(st))
cout << "Is Palindrome" << endl;
else
cout << "Not a Palindrome" << endl;
return 0;
}
Page 3