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
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What is wrong with this initialization?
What is memory leak in c?
Does * p ++ increment p or what it points to?
What is the difference between malloc() and calloc() function in c language?
write a program in c language to print your bio-data on the screen by using functions.
What is the use of linkage in c language?
What is wrong with this statement? Myname = 'robin';
What is the difference between printf and scanf )?
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.
What are the differences between new and malloc in C?
What is a pointer value and address in c?
What is the heap in c?
Can a file other than a .h file be included with #include?
Who developed c language?