C Program to find the exponential value
#include<stdio .h="">
#include<conio .h="">
#include<math .h="">
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</math></conio></stdio>