Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double e(double x)
- {
- double wynik = 1;
- double potega_x = 1;
- unsigned long long silnia = 1;
- for(int i = 1; i < 15; ++i)
- {
- potega_x *= x;
- silnia *= i;
- wynik += (potega_x / silnia);
- }
- return wynik;
- }
- int main()
- {
- cout << e(3.7);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement