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

An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

1032


What are qualifiers?

976


Can an array be an Ivalue?

1055


What does 3 mean in texting?

1030


What is function prototype in c with example?

1003


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2204


Which control loop is recommended if you have to execute set of statements for fixed number of times?

1298


How can you tell whether a program was compiled using c versus c++?

1044


What is the difference between the local variable and global variable in c?

927


What are volatile variables in c?

889


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

997


Differentiate between a structure and a union.

1227


What is structure padding in c?

1058


What is a structure in c language. how to initialise a structure in c?

1020


Why do we use namespace feature?

1009