code is compiling, but no output!
Some error is occuring
hello @kamakshi.behl22,
a) decalre ur p array as
int p[t+1];
t+1 because u are accessing index t.
b) becuase n can be upto 5000 000 and 5000 000th prime number can be really big therefore increase ur value of t such that 5000 000th prime number <=t
check this
a) i have changed the value of t
b) made p array global becuase we cannot declare big size array inside any function
c) removed if(n==0 || n==1) condtion becuase that was wrong
the code worked. but how to take value of t?
value of t is equal to value of 5000 000th prime number
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.