Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(int argc, char const* argv[])
- {
- double e = 1, dlt = 1;
- int fact = 1;
- int idx = 1;
- while (dlt > 1e-7) {
- fact *= idx++;
- dlt = 1.0 / fact;
- e += dlt;
- }
- cout << e << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement