Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

why do some people write if(0 == x) instead of if(x == 0)?

1031


Explain why c is faster than c++?

1033


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)

2259


What are operators in c?

986


What is c language and why we use it?

1028


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.

2062


I came across some code that puts a (void) cast before each call to printf. Why?

1174


What is a far pointer in c?

1005


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

2037


Is it valid to address one element beyond the end of an array?

1143


hi any body pls give me company name interview conduct "c" language only

2254


What is the best style for code layout in c?

1071


Why does everyone say not to use scanf? What should I use instead?

1387


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3648


What is the difference between a function and a method in c?

1050