class arrayfact
{
public static void main(String arg[])
{ int a[] = new int[arg.length];
int i, f , n;
for(i = 0 ; i < arg.length ; i++)
a[i] = Integer.parseInt(arg[i]);
for(i = 0 ; i < arg.length ; i++)
{ n = a[i];
for(f = 1 ; n > 1 ; n--)
f = f*n;
System.out.println("No : "+a[i]+" Factorial is " +f);
}
}
}
Not Working
ReplyDelete