Prime visits ( no. of primes in between two no. )

why my two of the three test cases not passed
my code is
https://ide.codingblocks.com/s/99324

You must be dealing with TLE.
This is happening because the exit condition you are using in the for loop causes unacceptable no. of iterations.
Thus, you should use a*a <=n

Hope, this would help.

I am marking this thread as resolved as you have not replied to it since 6 days.
off chance , you still have any doubt regarding the same, reopen it.

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.