#WSQ14 #TC1017

<iostream>

<cmath>

using namespace std;

 

float estimating_e (float n)

{

float x=0.0, e=0.0;

float factorial= 1;

for(float j=1; j<=n; j++)

{

factorial = factorial * j;

x = x + 1/factorial;

}

e = x + 1;

return e;

}

 

int main ()

{

float num;

cout<<“ingresa un número, entre mas grande mas preciso sera e”<<endl;

cin>>num;

cout<<“el aproximado de e es:”<< estimating_e(num)<<endl;

return 0;

}

CC BY 4.0 #WSQ14 #TC1017 by Joshua B. G. is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.