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
How do I read the arrow keys? What about function keys?
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
How can I do graphics in c?
shorting algorithmS
Write a Program to find whether the given number or string is palindrome.
Can we declare a function inside a function in c?
What do you mean by command line argument?
What is the 'named constructor idiom'?
What are qualifiers in c?
Why are all header files not declared in every c program?
What is optimization in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What do you mean by Recursion Function?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
What is a pointer and how it is initialized?