// Bjarne Stroustrup 7/20/2009 // Chapter 4 Exercise 11 #include "std_lib_facilities.h" // note that different compilers/SDEs keep header files in different places // so that you may have to use "../std_lib_facilities.h" or "../../std_lib_facilities.h" // the ../ notation means "look one directly/folder up from the current directory/folder" /* Compute prime numbers: 2 3 5 7 11 ... In case you forgot, a prime is a positive integer that can be divided only by 1 and by itself. For this exercise, we decided to consider 2 the first prime (ignoring 1). Our general strategy (our algorithm) is to see if a number can be divided by a prime smaller than itself and if not it is itself a prime and we add it to our vector of primes. I didn't bother with a separate vector of primes to compare with. Instead, I simply checked that the primes computed were the correct. */ vector prime; bool is_prime(int n) { for (int p = 0; p