Комментарии:
helpful tutorial, easy to understand 👍👍
Ответитьoh i found it's good to replace int with double for more numbers
Ответитьhow come when i put an integer greater or equal to 21, the factorial is negative? plz help
(it is negative for 21, 22, 24 and some others
you're awesome! Thanks!
Ответитьclass Factorial
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter a Number for factorial:");
n = sc.nextInt();
int number,fact=1;
for(int i=1; i<=number;i++)
{
fact=fact*i;
}
System.out.println("factorial Number is " + fact);
}
}
please learn english
ОтветитьWell explained
Ответитьhelped me a lott....thanx
ОтветитьThis helped!!!!!!!!!!!
Ответить