My code is not giving me correct answer please help
Hello @anshulgurawalia your function is not correct.
Firstly you have to iterate to all the even numbers with the help of the for loop starting from 2 and with increasing of 2 then mark all of them as 1 here you are marking them as 1 because even nunbers can never be prime with the exception of 2 .
And secondly in the other loop you will check start you loop from 3 till with the incremation of 2 and check if the number ud the multiple of I then mark it as 1
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.