T-Prime , Getting wrong answer

I figured out that the numbers which are square of the prime numbers would be the T-Prime here. But getting wrong answer , help me out with this,
First we calculate the square root of the number, and if that is prime then the number is T-Prime

Source code link: https://pastebin.com/aAnJYdhg

x can be of the range 10^12.
You have take x as an integer. Change everything to ll int and you are done.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.