#include<IOSTREAM.h>
main()
{
int rohan=0;
int m=10;
int l=10;
int t=10;
int flag1 =0;
int flag=0;
int temp;
float temp1;
long double n;
double k;
cout<<"ENTER N\n";
cin>>n;
k=n;
int camp;
camp=k;
while (flag1)
{
l*=10;
camp/t;
t*=10;
if (camp == 0)
{flag1=1;}
}
if ((1>n)&&(n>=1e6))
{cout<<"there is a error";}
else
{
while(flag==0)
{
k+=1;
while(l!=m)
{
temp1=k/l;
temp=m*(k/m-k);
m*=10;
l/=10;
if(temp1!=temp)
rohan=0;
else rohan=1;
}
if(rohan==1)
flag=1;
else
flag=0;
}}
if(flag==1)
cout<<"THE PALLINDROME IS "<<k;
else
cout<<"no such pallindrome exists";
return 0;
}
rohan121212 -4 Light Poster
rohan121212 -4 Light Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
AbEeR Q8 1 Newbie Poster
Muhammad Anas commented: this is exactly what I wanted to ask when I was looking at the first post of the thread :) +1
rohan121212 -4 Light Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
morganJohnson 3 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.