Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2055


Are there any problems with performing mathematical operations on different variable types?

1029


Explain what is the difference between the expression '++a' and 'a++'?

1203


What does c mean in basketball?

980


What is difference between stdio h and conio h?

1357


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1940


What is string function in c?

968


What is difference between function overloading and operator overloading?

1077


What are global variables and how do you declare them?

1073


What is #define in c?

1029


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

1312


What does the format %10.2 mean when included in a printf statement?

1638


Why we not create function inside function.

2175


Explain the difference between ++u and u++?

1114


How can you check to see whether a symbol is defined?

1090