Find mistake here

its printing not prime in every case

hi @uditmudgal07_2f40cca755bd8bd2,
your logic is incorrect and also u need to write in less than O(N) complexity
refer

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.