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
while initialization of array why we use a[][2] why not a[2][]...?
What are the disadvantages of c language?
Can a local variable be volatile in c?
which is an algorithm for sorting in a growing Lexicographic order
What is a floating point in c?
Give the rules for variable declaration?
The __________ attribute is used to announce variables based on definitions of columns in a table?
What is dynamic variable in c?
Why is structure important for a child?
What is equivalent to ++i+++j?
What is extern keyword in c?
I need testPalindrome and removeSpace
#include
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
what do you mean by enumeration constant?
How can you draw circles in C?