123456789101112131415161718192021222324252627282930
#include <iostream> #include <string> #include <iomanip> using namespace std; long long far(int); void main() { double e = 1; for (int i = 1; i <= 50; i++) { double addedValue = (1 / far(i)); e += addedValue; } cout << "The e equals: " << e; cin >> e; } long long far(int i) { if (i <= 1) { return 1; } else { return i * (far(i - 1)); } }
double addedValue = (1 / far(i));
123456
double result; int top = 1; int bottom = 8; // for example, say result = top/bottom;
double addedValue = (1.0 / far(i));