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 |
Explain what is the difference between functions abs() and fabs()?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Write an algorithm for a program that receives an integer as input and outputs the product of of its digits. E.g. 1234 = 24, 705 = 0
WAP to convert text into its ASCII Code and also write a function to decode the text given?
what type of language is C?
a simple program in c language
what are the various memory handling mechanisms in C ?
what is a headerfile?and what will be a program without it explain nan example?
What is assignment operator?
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?
what is level of tree if leaf node is at level 4.please explain.
Given an array of length N containing integers between 1 and N, determine if it contains any duplicates.