Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….
Answer Posted / dally
#include<stdio.h>
int main()
{
char c = 'X';
int i,n,sum = 0;
printf("Enter values for n\n");
scanf("%d\n",&n);
for(i=0;i<n;i++)
{
sum = sum+power(c,i)/fact(i);
}
fact(int i)
{
int p=1 ,fact;
if(p<=i)
{
fact = p*fact(p++);
}
return fact;
}
| Is This Answer Correct ? | 24 Yes | 43 No |
Post New Answer View All Answers
What is the use of bitwise operator?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
Explain the binary height balanced tree?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is the basic structure of c?
Is there any possibility to create customized header file with c programming language?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is console in c language?
What do you mean by c what are the main characteristics of c language?
What are the c keywords?
Can we declare variable anywhere in c?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What would be an example of a structure analogous to structure c?
Differentiate between the = symbol and == symbol?
How can I swap two values without using a temporary?