Prime factorization problem

here is my code : https://ide.codingblocks.com/

its showing segmentation fault . when does segmentation fault occurs ?? and how to correct it??

send correct link of code
your link doesn’t contains any code