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 |
char ch="{'H','I',0};printf("%s",ch);what is output
Why main function is special give two reasons?
whats the use of header file in c?
Why dont c comments nest?
What is #error and use of it?
Method Overloading exist in c ?
What are the types of c language?
Whether there can be main inside another main?If so how does it work?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
When is the “void” keyword used in a function?
Can you please explain the difference between strcpy() and memcpy() function?
What is the function of multilevel pointer in c?