Thread: palindrome
View Single Post

  #2 (permalink)  
Old 02-28-2008, 11:07 AM
lawrence lawrence is offline
Junior Member
 
Join Date: Mar 2007
Location: coimbatore, india
Posts: 23
lawrence is on a distinguished road
palindrome

a = xxxxxxxxx;
b = a;
c = 0;

while(b > 0)
{
c *= 10;
c += b%10;
b = b/10;
}

if(a == c)
{
'palindrome';
}
else
{
'not palindrome';
}
Reply With Quote