Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //funcao fatorial
- double fatorial(int n){
- int j;
- double f=1.0;
- for (j=1; j <= n; j++){
- f = f * j;
- }
- return f;
- }
- //programa para calcular numero de euler usanto a funcao fatorial
- void main (){
- double e;
- int i;
- for (i=1; 1.0/fatorial(i) < 0.000001; i++){
- e = e + 1.0/fatorial(i);
- }
- printf ("Valor aproximado do Numero de Euler:%f \n", e);
- system ("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement