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

How can I find the day of the week given the date?

0 Answers  


What are multidimensional arrays?

0 Answers  


I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?

3 Answers  


WAP &#8211; represent a char in binary format

4 Answers   Motorola, Wipro,


The code is::::: if(condition) Printf("Hello"); Else Printf("World"); What will be the condition in if in such a way that both Hello and world are printed in a single attempt?????? Single Attempt in the sense... It must first print "Hello" and it Must go to else part and print "World"..... No loops, Recursion are allowed........................

14 Answers   HOV Services, IBM, Potty,






what is function pointer?

2 Answers   Wipro,


write a program to display all prime numbers

0 Answers  


Does sprintf put null character?

0 Answers  


How can I convert integers to binary or hexadecimal?

2 Answers  


3.write a simple program that will output your name,phone number,e-mail address,and academic major on separate lines 1.create an account and a personal directory for your work b.find out how to create a subdirectory on your system.create one called info c.you will use a text editor to type in your programs and data files.some C systems have a built in text editor;others do not.Find out what text editor you will be using and how to access it.create a text file(not a program) containing your name ,address,and telephone number on separate lines.Next,write the brand of computer you are using and the name of the text editor.Then write a paragraph that describes your past experience with computers.save this file in your info directory. d. find out how to print a file on your system .print out and turn in the file you created in (c).

0 Answers   TCS,


What are static variables in c?

0 Answers  


application attempts to perform an operation?

0 Answers  


Categories