matthewmpp@annrogers:~/Programming/C.progs/Personal$ cat prime4.c
/*
* File: main.c
* Author: matthewmpp
*
* Created on November 7, 2010, 2:16 PM
*/
#include
Not sure I believe the answer above!
X = 5.0; Y = 0.0; Z = X/Y;
This will give a floating point exception....
The problem would appear to be that prime_pf is only initialised for 3 elements. So the modulo is attempting to divide by zero. BTW, if you add \n to your printf statement, and add the extra statement fflush(stdout); you are more likely to see the debug output before the program errors.