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 |
True or false: If you continuously increment a variable, it will become negative? 1) True 2) False 3) It depends on the variable type
6)swap(int x,y) { int temp; temp=x; x=y; y=temp; } main() { int x=2;y=3; swap(x,y); } after calling swap ,what are yhe values x&y?
What are all different types of pointers in c?
O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N
How can I handle floating-point exceptions gracefully?
What is a c token and types of c tokens?
What is a 'null pointer assignment' error?
Write a program that his output 1 12 123
What does the error 'Null Pointer Assignment' mean and what causes this error?
What will the preprocessor do for a program?
define switch statement?
write a program to find lcm and hcf of two numbers??