The program to check whether the given number is a palindrome or not is discussed here. Check below for the full code in different programming languages!
Any number is said to be a palindrome if the original number and the reverse of the original number are the same.
For example, 1234321 is a palindrome.nnOriginal number = 1234321nThe reverse of the number = 1234321n
A number can be checked if it is a palindrome or not in both iterative and recursive approaches. Both approaches are discussed below.
@@coding::1@@
Time complexity: O(n)
@@coding::2@@
Time complexity: O(n)
Friendly pair or not (amicable or not)