Skip to content

Commit f351c5c

Browse files
authored
Merge pull request #145 from ricglz0201/e-approximation
Approximation of e in cpp
2 parents 57031f8 + a26a6d5 commit f351c5c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main() {
5+
double factorial, e = factorial = 1.0;
6+
for(int i=1; i<10; i++){
7+
factorial*=i;
8+
e += 1.0 /factorial;
9+
}
10+
}

0 commit comments

Comments
 (0)