import java.io.*;

class H4Ex1
{

public static double exp(double x)
{
//exponensiyeli hesaplayan statik metod	
double faktoriyel=1;
double us=1;
double exponent=1;
for(double sayi=1;sayi<=200;sayi++)
{
faktoriyel*=sayi;
us*=x;
exponent+=us/faktoriyel;
}
return exponent;
}
public static double kare(double x)
{return x*x;}

public static void main(String args[]) throws IOException
{
BufferedReader cin=new BufferedReader(new InputStreamReader(System.in));
double x;
System.out.print("Bir sayi giriniz:");
x=Double.parseDouble(cin.readLine());
System.out.println("exp("+x+") = "+exp(x));
System.out.println("Java kutuphanesindeki metodu kullanirsak : ");
System.out.println("exp("+x+") = "+Math.exp(x));
System.out.println("kare metodu : ");
System.out.println("kare("+x+") = "+kare(x));
}
}
