whats wrong with this programme

can some 1 help me check where is the error...the logic shld b correct

#include <iostream>
#include <cstdlib>
using namespace std;

bool palindromes(long no);
int main ()
{
long num,no;
cout<<"Input a number to check if it is palindrome -> ";
cin>>num;

palindromes(long no);

if (no = true)
{
cout<<num;
cout<<" is a palindrome.";
}

else
{
cout<<num;
cout<<" is not a palindrome.";
}

cout<<endl;
system("pause");
return 0;
}

bool palindromes(long no)
{
long num, quation, remainder,RN;

quation=num;
RN=0;
do
{
remainder=quation%10;
quation=quation/10;

RN=RN*10+remainder;
}

while (quation!=0);

if (num==RN)
{
return true;
}

else
{
return false;
}
}
Please use [code][/code] tags
You are calling 'palidromes' in a wrong way:
1
2
3
4
5
long num,no;
cout<<"Input a number to check if it is palindrome -> ";
cin>>num;

palindromes(long no);// <-- ERROR 

call it this way: palindromes(num);
i change le still gt error
You also have errors like ...
1
2
3
4
5
if (no = true) // should be ==
{
cout<<num;
cout<<" is a palindrome.";
}
in main: if (no = true) should be if (palindromes(num))
in palindromes: quation=num; should be quation=no;
1
2
3
4
5
6
7
8
9
if (num==RN)
{
return true;
}

else
{
return false;
}
should be return no==RN;
its a function qn and i nid to return true and false to the palindromes(long num)
some 1 help me
What kind of error(s) do you have? What does your compiler say when you try to build? also you should post your updated code, and put it in between code tags.
Topic archived. No new replies allowed.