Your friend tells you that she's disappointed that "palindrome", a word or phrase that is the same backwards and forwards, is not itself a palindrome. Words such as "Bob" or "Taco cat" are palindromes.
However, "palindrome" is an "emordnilap", which is a recently coined word that denotes a word or phrase that creates another word backwards (such as "dog" and "god" or "desserts" an "stressed".
You decide to write a program that automatically reverses a string of up to 50 characters and prints out the result. Use arrays to reverse up to 50 characters and print them back to the screen. Assume there are no spaces.
using namespace std;
int main(){
char buffer[50];
cout<<"Enter a string to be reversed:"<<endl;
//size as a variable is needed here because you don't know, a priori, how much of buffer will be filled
//you will later learn a way to measure the size of an array directly, but don't worry about that here.
int size = 0;
for(int i = 0; cin>>buffer[i]; i++)
{
size++;
}
// What do you need to add to the end of the array?
char reversedbuffer[50];
// Reverse the buffer from the buffer array into the reversedbuffer array
// Don't forget what you need to add to the end of the reversedbuffer array
cout<<"reversed string:";
// Print out the string (don't use a loop if you can help it)
// Don't print a newline (endl)...we'll do that ourselves.
cout << endl;
return 0;
}