To jayman9:
M_E is a Standard Constant that stands for the value of e (2.71828...)It is defined in the math.h or the cmath header file.
To jaclyn_85:
You don't need to place M_E in the variable e, since you're not using e anywhere in the program.
There were a lot of unterminated strings in the printf statement as well as missing semicolons.
Besides that, there is one major mistake.
CODE
population = 1 * ( M_E ^ (( 1 - k ) * generations ));
Unlike BASIC and other languages, in the C/C++ language,
the ^ operator stands for a XOR Operation rather than a "power-of" operation.You need to use the pow() function for this.
Change the above statement to this:
CODE
population = 1 * ( pow(M_E,(( 1 - k ) * generations) ));
The code works fine after that.