write a program that eliminates the value of mathematical
constant e by using the formula
e=1+1/1!+1/2!+1/3!+

Answer Posted / devang

/* Fact = factorial, n = no. of terms */
main()
{
int fact=1,i,n;
float e=0;
printf(" Enter the no. of terms");
scanf("%d",&n);

for(i=1;i<=n,i++)
{
fact=fact*i;
e = e + (1/fact);
}
printf("he value is = %f", e);
return 0;
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which header file should you include if you are to develop a function which can accept variable number of arguments?

795


What is wrong with this initialization?

577


What is memory leak in c?

627


Does * p ++ increment p or what it points to?

602


What is the difference between malloc() and calloc() function in c language?

592






write a program in c language to print your bio-data on the screen by using functions.

6239


What is the use of linkage in c language?

609


What is wrong with this statement? Myname = 'robin';

810


What is the difference between printf and scanf )?

581


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2213


What are the differences between new and malloc in C?

602


What is a pointer value and address in c?

622


What is the heap in c?

635


Can a file other than a .h file be included with #include?

675


Who developed c language?

630