Make sure the code you're working with is identical to what you posted. Make the required changes. Then delete the executable and object files. Recompile the code and link.
If using an IDE...
Type: Posts; User: grumpy
Make sure the code you're working with is identical to what you posted. Make the required changes. Then delete the executable and object files. Recompile the code and link.
If using an IDE...
The first iteration through the loop year is zero, so the argument to exp() is zero. exp(0) is always 1. So the first time through the loop sets cobalt_initial to zero. On subsequent...