Program to find the value of e raised to power x using while
loop
Answer Posted / s.d.bahinipati
#include<stdio.h>
#include<math.h>
main()
{
int i,j,n,x,fact=1;
float c,t,sum=1;
printf("enter the value of x and n);
scanf("%d%d",&x,&n);
while(i<n-1)
{
c=pow(x,i);
for(j=1;j<i;j++)
fact=fact*j;
t=c/fact;
sum=sum+t;
}i=i+1;
printf("the sum of series is %f",sum);
getch();
}
| Is This Answer Correct ? | 34 Yes | 28 No |
Post New Answer View All Answers
What is a program flowchart and how does it help in writing a program?
How to Throw some light on the splay trees?
write a program to create a sparse matrix using dynamic memory allocation.
Why can’t constant values be used to define an array’s initial size?
What is storage class?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
largest Of three Number using without if condition?
What is the use of a semicolon (;) at the end of every program statement?
What are different types of pointers?
Is it possible to pass an entire structure to functions?
What is dynamic dispatch in c++?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is the difference between far and near ?
Distinguish between actual and formal arguments.