We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 57031f8 + a26a6d5 commit f351c5cCopy full SHA for f351c5c
honorary-one-line-wonders/cplusplus/e_approximation.cpp
@@ -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