sir, in the prime_sieve function, why we taking array p as (int *p) . why can we just use (int p[]) .
and also , why we are using long long in the for loops in sieve function?
can’t we just use (int i=3;i<=1000000;i+=2) ?
sir, in the prime_sieve function, why we taking array p as (int *p) . why can we just use (int p[]) .
and also , why we are using long long in the for loops in sieve function?
can’t we just use (int i=3;i<=1000000;i+=2) ?
hello @r_kumar_17
both will work in same manner , use any of them
becuase in inner loop we are using ii and this ii may exceed the range of int hence using long long to avoid range overflow
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.