#include <iostream> #include <cmath> #include <vector> double calculate_exponential_growth(double initial_value, double growth_rate, int periods) { return initial_value * expm1(growth_rate * periods); } int main() { double initial_value = 1000; double growth_rate = 0.01; int periods = 10; double final_value = calculate_exponential_growth(initial_value, growth_rate, periods); std::cout << "Final value after " << periods << " periods: " << final_value << std::endl; return 0; }