I need to write a program to create palindrome words by using the string entered by users.
The program should have 2 strings:
the first string is used to store input text from the user
and the second string is to store the same input text from the user in reverse direction.
Display the palindrome words at the end of program.
Sample of input: ABCD
Sample of output: ABCDDCBA
this is my code, but it is not working as I want :
#include <iostream>
using namespace std;
int main()
{
char i;
string str1[i], str2[i];
cout << "please Enter the text " << ": "<<"\n";
cin >> str1[i];
for (int i = 0; i < 10; i++)
cout << str1[i] << endl;
cout << "\n";
for (int i = 9; i >= 0; i--)
cout << str2[i] << endl;
return 0;
}