In this program user ask to find the exponential Power of value. Exponents are shorthand for repeated multiplication of the same thing by itself. User declares double type variable or float and int. two variables temp and expo assigned value 1. User asks to enter the value for expo and then the loop statement configures the condition to evaluate output. In loop statement the term variable is been manipulated with the x or I. and after all the manipulation the output is print out on the screen.
Problem Statement:
This program is to find out the exponential power of digit.
- Declaring the variable.
- Using loop statement.
- Display result on the screen.
Here is C source code for finding the exponential power. The output of this program shown below.
#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();
}