/******************************************************************************* * This is a simple serial version of computing pi using the Monte Carlo Method * The model asks the user to enter the number of iterations to use for * estimating pi * * Mobeen Ludin * ******************************************************************************/ #include #include #include #include #include #define SEED 35791246 int main (int argc, char **argv){ double start_time, end_time, time_diff; int num_iteration = 0; double x, y; int i; int count = 0; // Number of points in the first quadrant of unit circle double z, pi; printf("Please enter the number of iterations used to compute pi: "); scanf("%d",&num_iteration); // Record the start time from here on: start_time = omp_get_wtime(); srandom(SEED); // this will initialize some random numbers count = 0; for(i=0; i