top of page
import java.util.*;
public class taylor {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("bir sayı girin ");
double x=input.nextDouble();
double top=0;
for(double n=1.0;n<=100;n++){
top+=(1/faktoriyel(n))*Math.pow(x,n);
}
double sonuc=top+1;
System.out.println("exp("+x+")= "+sonuc);
}
public static double faktoriyel(double number){
double toplam=1;
for(int i=1;i<=number;i++){
toplam*=i;
}
return toplam;
}
}
bottom of page