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
why do some people write if(0 == x) instead of if(x == 0)?
Explain why c is faster than c++?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
What are operators in c?
What is c language and why we use it?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
I came across some code that puts a (void) cast before each call to printf. Why?
What is a far pointer in c?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Is it valid to address one element beyond the end of an array?
hi any body pls give me company name interview conduct "c" language only
What is the best style for code layout in c?
Why does everyone say not to use scanf? What should I use instead?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What is the difference between a function and a method in c?