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
What would be an example of a structure analogous to structure c?
Why can’t we compare structures?
What is the use of the function in c?
What are the advantages of c preprocessor?
What is the difference between functions getch() and getche()?
What is string length in c?
Compare array data type to pointer data type
What is the difference between class and object in c?
What is function prototype in c with example?
Differentiate between a for loop and a while loop? What are it uses?
What do you understand by friend-functions? How are they used?
Explain the difference between #include "..." And #include <...> In c?
How do c compilers work?
explain what are actual arguments?
What is p in text message?