A PLATFORM TO LEARN | CODE | ACHIEVE
" Programming is the real test of your creativity,its all about how you turn ideas into codes. "
ENTER THE NUMBER :23432
YES IT IS THE PALINDROME NUMBER
What we did - Our Approach
In this problem we have to check whether the given number is a Palindrome or not.
A palindromic number or numeral palindrome is a number that remains the same when its digits are reversed. Like 16461, for example, it is "symmetrical". Hence,it is quite clear that if a number is equal to its reversal then it is a palindrome number.
***FINDING THE REVERSE OF A NUMBER***
Let us consider an example :
Suppose we have to find the reverse of 535,we require three steps which needs to be performed under while loop condition (while n>0).
1 : Finding Remainder : rem=num%10
2 : Finding Reverse : rev=rev*10+rem
3 : Updating number : num=num/10;
But num>0, so we will perform above steps until 'num' gets equal to zero.After the last iteration we find rev=535.
Now we check whether the reverse of a number is equal to itself or not.In this case,535 is a Palindrome Number.
INTERESTING READ FOR YOU :
For any Queries,suggestions,feel free to Mail us at :
For reporting any kind of copyright voilation,mail us at : email@example.com
© copyright CODE OF GEEKS 2018