‘Palindromic Prime’ or in short ‘Pal Prime’ is a number, which is simultaneously palindrome and prime. It is not necessary that every palindromic number should be prime. Consider 22. It is palindromic, but not prime. It has factors more than 2.
Now prime is a number where factors will be only 1 and that number, like 11. The number 11 is divisible by only 1 and that number 11. Furthermore it is palindromic. If you place the number in reverse order, it will read the same.
In this program, we will test whether the number is palindromic and prime both.