For array of 5000000 showing error.
Test 0 and 1 showing run time error
@anishnair95 In you submissions you are not implementing sieve of Eratosthenes. Second to create an array of order of 10^6 or 10^5 make them as global array.
If this resolves your doubt mark it as resolved.
All my test cases passed but the same code not working on codeblocks online compiler.It shows error
You are declaring arrays of size 10^8, it can cause TLE, and also Compilation array, neither declare array of size less then required nor of size more than required.
If this resolves your doubt mark it as resolved.