The program should print numbers whose factors sum up to prime numbers. However, there is something wrong with int primes(n) function.
I get into infinite loop and print statements show that p : 5 and divisor : 4 and it stays like that in that loop. I cannot find a flaw in my logic.
Use a debugger like gdb or what's built in to you IDE to step through loop, and verify what each variable each iteration. If you have a logic error, this will find it.
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.