I created a code to print list of all primes from 2 to 50..but it's not working...plz help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I created a code to print list of all primes from 2 to 50..but it's not working...plz help

https://code.sololearn.com/cZ22wzB1kr7F/?ref=app

17th Feb 2020, 4:29 AM
PRO
PRO - avatar
2 Answers
+ 7
Your code was very close, but had one small issue. You were essentially adding every non-prime number. A simple not fixes this: https://code.sololearn.com/cMeA7PMPkuM6/?ref=app
17th Feb 2020, 4:57 AM
Jax
Jax - avatar
+ 2
Jax That's very kind of u man...thnx
17th Feb 2020, 5:01 AM
PRO
PRO - avatar