#include <iostream> #include <cmath> #include <fstream> int main() { std::ofstream file("cosh_data.txt"); double x_start = -5.0, x_end = 5.0, step = 0.1; for (double x = x_start; x <= x_end; x += step) { file << x << " " << cosh(x) << std::endl; } file.close(); std::cout << "Data written to cosh_data.txt" << std::endl; return 0; }