write a program that eliminates the value of mathematical
constant e by using the formula
e=1+1/1!+1/2!+1/3!+
Answer / 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 |
Is main a keyword in c?
1. Can we use the for loop this way? for(;i>5;) 2. What is the use of pointers? 3. what is array of pointer? 4. What is the difference between file and database? 5. Define data structure?
Is it possible to have a function as a parameter in another function?
what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
7 Answers Cadence, JNTU, Zen Technologies,
Write a program to find whether the given number is prime or not?
#define f(x) main() { printf("\n%d",f(2+2)); }
how can i get this by using for loop? * ** * **** * ******
Explain how do you determine whether to use a stream function or a low-level function?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
how to find that no is int or float?
What is the c language function prototype?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.