Shopping In MUMBAI

Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top. Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.

Wednesday, December 31, 2008

C Program to find the exponential value

C Program to find the exponential value

#include
#include
#include
int fact(int no)
{
int i,f=1;
for(i=1;i<=no;i++)
{
f=f*i;
}
return f;
}
void main()
{
int x,n,f,j;
float e=1,p;
clrscr();
printf("\nEnter the value of x: ");
scanf("%d",&x);
printf("\nEnter the value of n: ");
scanf("%d",&n);
for(j=1;j<=n;j++)
{
p=pow(x,j);
f=fact(j);
e=e+p/f;
}
printf("\nExponential value is %0.2f",e);
getch();
}

**************OUTPUT**************

Enter the value of x: 2

Enter the value of n: 3

Exponential value is 6.33

C Program to find the exponential valueSocialTwist Tell-a-Friend

0 comments:

SUPPORT THIS BLOG