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 .obj file in c?
Is javascript written in c?
What are valid signatures for the Main function?
what do the 'c' and 'v' in argc and argv stand for?
Is multithreading possible in c?
What are the advantages of using linked list for tree construction?
How to set file pointer to beginning c?
What is ambagious result in C? explain with an example.
What are c identifiers?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Is fortran faster than c?
Explain what are compound statements?
Is there a way to jump out of a function or functions?
how to write optimum code to divide a 50 digit number with a 25 digit number??