C program to find Palindrome Number
Palindrome Number:
Palindrome number is the number which is same after reverse.
Example:
121,23432,545 are palindrome numbers.
123,546,7634 are not palindrome numbers.
C Program:
Output 1:
Output 2:
From the above program,
ü let num=5335
ü n=num, n=5335
n>0 |
r=n%10 |
sum=(sum*10)+r |
n=n/10 |
5335>0 |
r=5335%10 =5 |
sum=(0*10)+5 =5 |
n=5335/10 533 |
533>0 |
r=533%10 =3 |
sum=(5*10)+3 =50+3 =53 |
n=533/10 =53 |
53>0 |
r=53%10 =3 |
Sum=(53*10)+3 =533 |
n=53/10 =5 |
5>0 |
r=5%10 =5 |
sum=(533*10)+5 =5335 |
n=5/10 =0 |
0>0 false |
Doesn’t execute |
0 Comments