Prime numbers problem in c