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 spaghetti programming?
Do you have any idea about the use of "auto" keyword?
Can we change the value of static variable in c?
What is the use of static variable in c?
What are linked lists in c?
Explain what is dynamic data structure?
Which is better between malloc and calloc?
What is calloc() function?
What is maximum size of array in c?
Why doesnt this code work?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
How will you find a duplicate number in a array without negating the nos ?
Can we declare variables anywhere in c?
Give the rules for variable declaration?
What is typedef example?