Prime generator doubt

Hi Mohit,

I tried writing code for Prime generator ,which works fine for all sample inputs that I provide.
But the test cases fails with time limit error.

saved my code here :
https://ide.codingblocks.com/s/149595

Can you please help.

Hey @pradeep.itian,
I know you have written code correctly, the reason for Time Error is the complexity of problem. If you want to pass all the test cases you need to think of an efficient algorithm to compute prime numbers…
This topic is kinda belongs to the competitive programming, so even if you want to skip this particular ques you can, it won’t hamper your learning in ML sections.