Deepak and primes

what is wrong in this code

@Tiya See the constraints:
Constraints
1<=n<=5000000

You have restricted the array size to 100 and computing prime numbers only till 100. You have to do it till 5000000

its giving run error

on changing to 500000

Make the changes and share your code again if it still gives error. Make a prime Sieve for n<=5000000. Do not restrict it to 100 as you have done earlier. Here run error is mainly due to array index outof bounds ie. you are trying to access an index of the array beyond its size. Check your code once.

Check it now. You have to use long long int .

testcase 2 and 5 re still giving no output

2 test cases are still giving no output

Refer this.

oh what was the error?

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.