answersLogoWhite

0


Best Answer

#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
This answer is:
User Avatar

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
Related questions

Program for sin series in c language?

find the program in c-pgms.blogspot.com


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


How do you write socket program in c?

For first find an example program.


C program to find area of a triangle?

find the area of abc a[2,3] c[6,0]


C program to find the mean median mode?

try this---&gt; http://c-pgms.blogspot.com/2008/08/program-to-find-meanmedianand-mode_22.html


Write a c program to find the greatest number of from three number using switch?

Oh, well, simply: max = (a + b + c * 2 + abs(a - b) + abs(a + b - c * 2 + abs(a - b))) / 4;


Write a C program called MonthDays to find the number of days in a given month Test your code with different input values to demonstrate that your function is robust?

Write a C program called MonthDays to find the number of days in a given month Test your code with different input values to demonstrate that your function is robust?


How do you program an ungrouped median?

find median of n observation in c program


Write a c program to find given number is prime or not?

Yes, do write, or if you're too lazy to your homework, use google.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Program in c find the largest number out of ten with the help of for loop?

largestNum = 0; for ( i = 0; i &lt; 10 ; i++) { if ( currentNum[i] &gt; largestNum) largestNum = currentNum[i]; }


A c program to find maximum number in a 3 by 3 matrix?

int matrix[][]; // the matrix to find the max in int max = matrix[0][0]; int r,c; for(r = 0; r &lt; 3; ++r) { for(c = 0; c &lt; 3; ++c) { if(matrix[r][c] &gt; max) { max = matrix[r][c]; } } } // max is now the maximum number in matrix