-
exponential
Prepare a program that reads two integers x and n,
and calculate exp using the following formula:
exp = 1+ x/1 +x2/2! +x3/3! + ...
x2,x3 means x power 2, x power 3.
The integer n is used to govern the number of terms that
will be used for obtaining the approximate value of exp.
-
Yep, that's exponential alright... so what's the problem? We can't just write the program for you...
-
Code:
int i, x, n;
printf( "Enter...." );
scanf( "%d %d", &x, &n );
for ( i = 0 ; i < n ; i++ ) {
// your turn
}