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 are runtime error?
What is unsigned int in c?
Why we use void main in c?
Why do some versions of toupper act strangely if given an upper-case letter?
Why header files are used?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Which header file is essential for using strcmp function?
Is null valid for pointers to functions?
What is the use of ?
Can we change the value of constant variable in c?
What is a pragma?
How can my program discover the complete pathname to the executable from which it was invoked?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Why do we use & in c?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff