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
Why is extern used in c?
What are the 5 types of organizational structures?
What are the rules for the identifier?
What is s in c?
What does 4d mean in c?
Why is struct padding needed?
Can the sizeof operator be used to tell the size of an array passed to a function?
#include
Why c is called free form language?
Explain what is meant by 'bit masking'?
Explain what is a pragma?
Why do we use int main?
What is void main () in c?
Is null valid for pointers to functions?
What does c mean?