Could u check my code it is giving segmentation fault

here it is https://ide.codingblocks.com/s/245863

@sshreya2912
There is mistake in creating sieve

  1. use long long int everywhere is primeSieve() function
  2. why have you passed p array in primeSieve() function. Your p array stores input and is of size n. create another array say ll pn[1000006] and then pass it to function.
    Here is your updated code: https://ide.codingblocks.com/s/245909