Tech Mahindra interview question

Write a code to check whether a given number is palindrome.