import javax.swing.*;
public class H2YOEx3
{
public static void main(String args[])
{
// e^x = 1+x/1!+x^2/2!+x^3/3!+x^4/4!+ ..
// not : e=2.7182818
double faktoriyel=1;
double x;
double us=1;
double exponent=1;
x=Double.parseDouble(JOptionPane.showInputDialog("Bir sayż giriniz:"));
double sayi=1;
while(sayi<=200)
{
faktoriyel*=sayi;
us*=x;
exponent+=us/faktoriyel;
sayi++;
}
JOptionPane.showMessageDialog(null,"exp("+x+") = "+exponent, "e^x = 1 + x/1! + x^2/2! + x^3/3! + ....",
JOptionPane.PLAIN_MESSAGE);
}
}