Unknown error please check

actually you are dividing by zero that is the error

the problem is your are using p array but you have to use only prime nos

see the modified code

Modified Code

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved
if you have more doubts regarding this feel free to ask