// // Summary of the libraries included here // iostream - write to the screen // stdlib.h - random number generator // time.h - functions related to the system clock // math.h - mathematical functions // // To compile this program: // g++ exercise02.cc -o exercise02 // // And to run it: // ./exercise02.cc #include #include #include #include using namespace std; int main(){ // First of all we must initialise the random generator with a seed srand(time(0)); // variables that we'll use to estimate the areas of // the square and the circle int square = 0; int circle = 0; // number of random points to generate int N = 100; // Now let's make a cycle, and get pairs of random numbers for(int i=0; i