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

Can 'this' pointer by used in the constructor?

1079


What is pragma in c?

1189


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1862


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1706


What is the use of header?

1077


How can I make it pause before closing the program output window?

1029


Define the scope of static variables.

1110


What is non linear data structure in c?

1006


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1342


Can true be a variable name in c?

1020


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1043


What is a dynamic array in c?

1135


What is meant by type specifiers?

1111


Explain what are multibyte characters?

1167


I heard that you have to include stdio.h before calling printf. Why?

1045