Help with program

I need help writing a program that displays all the palindrome numbers between 1 and a user inputted number, n. The entire code is below, it's for an assignment. The program works but I have no idea how to display all the palindrome numbers between 1 and n.

do
{

int n, t1 = 0, t2 = 1, nextTerm = 0;

cout << "\nEnter an integer ";
cin >> n;

if (n>0 && n<160)
{

cout <<" "<<endl;
cout << "First "<<n<<" terms of Fibonacci series are:- \n";

for (int i = 1; i <= n; ++i)
{
if(i == 1)
{
cout << t1;
continue;
}
if(i == 2)
{
cout<<" ";
cout << t2 <<" ";
continue;
}
nextTerm = t1 + t2;
t1 = t2;
t2 = nextTerm;

cout << nextTerm << " ";

}

int digit, num, rem, sum = 0;
num = n;

while(num != 0)
{
digit = num % 10;
sum += digit * digit * digit;
num /= 10;
}
if(sum == n)
{
cout <<" \n\n"<< n << " is an Armstrong number.\n";
}
else
{
cout <<" \n\n"<< n << " is NOT an Armstrong number.\n";
}


long long int a,factorial=1;
for (a=1;a<=n;a++)
{
factorial = factorial * a;
}
cout <<"\nFactorial of "<<n<<" is: "<<factorial<<endl;


int reversenumber=0, counter, b=n;
while ( b!=0)
{
counter = b%10;
reversenumber = (reversenumber *10) + counter;
b /=10;
}
cout <<"\nReverse of "<<n<<" is: "<<reversenumber<<endl;

int n1,dig1,rev=0;
n1=n;

do{dig1=n%10;
rev=(rev*10)+dig1;
n=n/10;} while (n!=0);

if (n1==rev)
cout<<n1<<" is a palindrome";
else
cout<<n1<<" is not a palindrome";
The entire code is below ... The program works


I have to say, I beg to differ.
Topic archived. No new replies allowed.