Why this code of Prime numbers is not working (link given below)?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why this code of Prime numbers is not working (link given below)??

https://code.sololearn.com/cvczs2eM96DJ

2nd Aug 2019, 7:45 AM
Diptaraj Sen
Diptaraj Sen - avatar
1 Answer
0
Variable rem is instantiated inside a loop, therefore it cannot be reached outside of it. Moving it outside the loop will fix the compilation error, but will not give the correct results.
2nd Aug 2019, 8:08 AM
Rohbot