You'll have to move your code that checks for the middle letter and make sure it's only executed once, and you could use static variables to keep track of things -
Code:
#include <iostream>
using namespace std;
bool palindrome ( int half , int mod )
{
char letter1, letter2, oddletter;
static bool status = true;
static bool oddgot = false;
if ( half-- >= 1){
status=true;
oddgot=false;
cin >>letter1;
cout << letter1;
palindrome ( half, mod );
if ( mod == 1 && oddgot==false) {
cin >>oddletter;
cout << oddletter;
oddgot=true;
}
cin>>letter2;
cout << letter2;
if ( letter1 != letter2 )
status = false;
}
return status;
}
int main()
{
const int StopVal = 0;
int num,mod=0;
cout << "Enter the number of letters in your candidate palindrome, or\n"
<< "enter " << StopVal << " to end this program.\n\n";
cout << "Enter the number of letters (" << StopVal << " to stop) here ==> ";
cin >> num;
while (num != StopVal) {
cout << "Enter the palindrome candidate ==> ";
if(palindrome(num/2, num%2))
cout << " is a palindrome.\n" << endl;
else
cout << " is not a palindrome.\n" << endl;
cout << "Enter number of letters for the next candidate ("
<< StopVal << " to stop) ==> ";
cin >> num;
}
return 0;
}