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
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
What are qualifiers?
Can an array be an Ivalue?
What does 3 mean in texting?
What is function prototype in c with example?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Which control loop is recommended if you have to execute set of statements for fixed number of times?
How can you tell whether a program was compiled using c versus c++?
What is the difference between the local variable and global variable in c?
What are volatile variables in c?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Differentiate between a structure and a union.
What is structure padding in c?
What is a structure in c language. how to initialise a structure in c?
Why do we use namespace feature?