Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int fatorial(int x)
- {
- int y,a = x;
- for(y = 1; y<x; y++)
- a*=y;
- return y;
- }
- float neperiano(int x)
- {
- int y;
- float buf = 0;
- for(y=1; y<=x; y++)
- buf+=1/fatorial(y);
- return buf;
- }
- int main()
- {
- int x,k;
- float resultado;
- printf("Digite o numero ");
- scanf("%d",&x);
- printf("%f\n",neperiano(x));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement