Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….



Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+……â€..

Answer / 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

More C Interview Questions

print 1-50 with two loop & two print Statement

2 Answers  


Every time i run a c-code in editor, getting some runtime error and editor is disposing, even after reinstalling the software what may be the problem?

2 Answers  


increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

0 Answers  


what is the c.

3 Answers   IBM, TCS,






who invented c

13 Answers   IBM,


write a program to find out number of on bits in a number?

17 Answers   Huawei, Microsoft,


Difference between goto, long jmp() and setjmp()?

0 Answers   EXL,


how c source file in converted to exe file

5 Answers   KPIT,


is compiler do read the data line by line or not. ??

6 Answers   LG Soft, Satyam, Tech Mahindra,


program to find the magic square

1 Answers   Infosys,


What are the similarities between c and c++?

0 Answers  


Categories