Magnetic Life
Beta member
- Messages
- 3
I made a program to check weather an entered number is a palindrome or not ...
There is some error, can any one help me ...
Code:
#include<iomanip>
#include<cctype>
using namespace std;
int main()
{
int count=0,d=0;
long int array[count];
cout << "Enter a number";
for(count=0;;count++)
{
cin >> array[count];
if(!isdigit(array[count]))
break;
}
for(int check=0; check<=count; check++,count--)
{
if(array[check]==array[count])
d++;
if(d==count)
cout << "the number is a palindrome";
}
return 0;
}
There is some error, can any one help me ...