C PROGRAM FOR EXPONENT VALUE
Returns the base-e exponential function of x, which is the e number raised to the power x. In C, this function is overloaded in <complex> and <valarray> (see complex exp and valarray exp). Exponential value of x.If the the magnitude of the result is so large that it cannot be represented in an object of the return type, the function returns HUGE_VAL, and the value of the global variable errno is set to the ERANGE value.
CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
double term=1,expo=1;
float x;
int i;
clrscr();
printf("Enter the exp value of x: ");
scanf("%f",&x);
for(i=1;term>=0.00001;i++)
{
term *= x/i;
expo+=term;
}
printf("\Our Exp = %f %f\n",x,expo);
getch();
}

0 comments:
Post a Comment