Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include"stdafx.h"
- #include "string"
- #include <iostream>
- using namespace std;
- int main()
- {
- int i;
- float f = 1, n, e = 1;
- cout << "Enter N : ";
- cin >> n;
- for (i = 1;i <= n;i++) {
- f = f*i;
- e += 1 / f;
- }
- cout << "E : " << e << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment