SEGMENTATION FAULT

Each and every code of mine is getting segmentation fault, core dumped.
I don’t understand why this is happening even though the code is same line by line.
This problem happened with me in prime sieve,then in large primes and then in factorisation too.

I’ll attach the links to my codes.

FACTORISATION - https://ide.codingblocks.com/s/422331

PRIME SIEVE -

none of the code you shared gives me segmentation faults

The factorization code that i’ve shared isnt giving the correct ouput.