answersLogoWhite

0

#include <stdio.h>

long factorial(int n) {

long result = 1;

for (int i = 1; i <= n; ++i)

result *= i;

return result;

}

int main ()

{

double n=0;

int i;

for (i=0; i<=32; i++) {

n=(1.0/factorial(i))+n;

}

printf("%.32f\n", n);

}

//2.71828182845904553488480814849027

User Avatar

Wiki User

11y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao

Add your answer:

Earn +20 pts
Q: C program to find euler's number e?
Write your answer...
Submit
Still have questions?
magnify glass
imp