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


Please Help Members By Posting Answers For Below Questions

What is .obj file in c?

655


Is javascript written in c?

587


What are valid signatures for the Main function?

706


what do the 'c' and 'v' in argc and argv stand for?

652


Is multithreading possible in c?

574






What are the advantages of using linked list for tree construction?

653


How to set file pointer to beginning c?

677


What is ambagious result in C? explain with an example.

2061


What are c identifiers?

636


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

655


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.

662


Is fortran faster than c?

589


Explain what are compound statements?

613


Is there a way to jump out of a function or functions?

643


how to write optimum code to divide a 50 digit number with a 25 digit number??

2762