السلام عليكم
اخواني في الله أنا مبتدئ في الجافا ولدي سؤال
الا وهو
write applacation that computes the value ox exp bu using the formula

وهذا حلي
import java.util.Scanner;
public class sixthC
{
public static void main (String args[])
{
Scanner input=new Scanner(System.in);
int x,n;
int fact=1;
double exp=1;
int j=1;
double power=1;
double result,z;
System.out.println("Enter number integer");
n=input.nextInt();
for(x=1;x<=n;x++)
{
if(n==0)
fact=1;
else
if(n==-1)
fact=0;
else
fact=fact*x;
}
for (x = 1;x<=n;x++){
power = power * x;
}
while(x<=n)
{
exp =n/ (power / fact);
x++;
}
System.out.println("The Exp is="+exp);
System.exit(0);
}
}