Refer to the C coding standards to educate yourself on what we expect of your code. ALIGN CODE and HAVE GOOD STYLE. I'm taking off mucho points for code that's hard to read. You have had plenty of warning.
Note: If you mess up on 7 and didn't attempt the intermediate step (6), you will be penalized more heavily. I'd rather have a working version of 6 than only a broken version of 7.
Testing 17:
2 is not a factor of 17
3 is not a factor of 17
4 is not a factor of 17
...
16 is not a factor of 17
17 is prime!
Then, Harvey's suggestion of reducing the number of possible factors to reduce the amount of output makes more sense.
Also, you can stop looping when you find the first factor of a number.
Testing 9:
2 is not a factor of 9
9 is not a prime: 3 and 3 are factors of 9.