Tuesday, August 10, 2010

Article | Java Program To Find the exponential of a number.

Java Program To Find the exponential of a number.


public class Exponential {

public static void main(String[] args) {
double x = Double.parseDouble(args[0]);
double sum = 0.0;
double term = 1.0;
for (int i = 1; sum != sum + term; i++) {
sum = sum + term;
term = term * x / i;
System.out.println(i + " " + term + " " + sum);
}
System.out.println(sum);
System.out.println(Math.exp(x));
}

}

Loading...

Comments :

0 comments to “ Java Program To Find the exponential of a number. ”

Top Views

BloggerTipsTemplates

CHICKLETS

Enter your email address:

Delivered by FeedBurner

Followers