this is my code
I don't understand why is there a run time error in my code to check if a number is prime
Hey @arth.singh863 while checking prime a should start from 2 not 0, and C++ doesn’t allow modulo wiith 0, so when a = 0 your code tries to calculate modulo with 0 which results in error.
oh yes, i forgot that, thanks!
If your doubt is clear, please mark it as resolved.
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.