Well, this seems to be a bit strange..
this is the simple palindrome code..
As we know the input N is palindrome.. but its returning 0..
# include <stdio.h>
int palindrome (int n)
int rev=0, k;
k = n%10;
rev = rev * 10 + k;
n = n/10;
if (rev == n)
int main (void)
I checked the value of rev after the calculation ... it went fine.
but when I use this condition
if (rev ==n)
something is going wrong inside..
I checked the value of rev & n values after that .. they get turning to 0;
where's the little bug, that's hiding?