Check Prime - 0 and 1 are not prime

The code which i have submitted is also the same as my code taught me in the course .But the code passes all test cases of the question,but iby providing random test case number example 1 or 0 the code tells them to be prime and the compiler still passes all the test cases.

Check the constraints on n for this question. They clearly specify that n > 2.

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.