Write a java program to find factorial of a number in java?

preview_player
Показать описание
#learnwithkrishnasandeep #javacodinginterviewquestions #javaexamples #javaprograms #javatutorials #javaprogramming java program to find factorial of a number without using recursion,
java program to find factorial of a number using for loop,
java program to find factorial of a no,
java program to find factorial of a given number,
java program to find factorial of a number,
java program to find factorial of any number,
java program to find a factorial of a number,
write a java program to find factorial of a number,
write a java program to find factorial of a given number
Рекомендации по теме
Комментарии
Автор

you haven't print the fact variable brother, then only it will print the factorial of any number

SmartProgramming
Автор

output sir.hoq can we whether it is right or wrong

RamuRamu-jqro
Автор

here I tried it. private static Scanner scanner = new Scanner(System.in);
public static void main(String arg[]) {

int input = scanner.nextInt();
int fact = 1;
for (int i=1; i<=input; i++) {
fact = fact * I;
System.out.println(fact);
}
}

Finance_Worklife
Автор

Below program will gives output

public class Factorial {

public static void main(String[] args)
{
int l=5;
int fact=1;
for(int i=1;i<l;i++)
{
fact+=fact*i;
}
System.out.println(fact);

}

}
output:120

BabyShanvika
Автор

if you think I'm right.
import java.util.*;
import java.util.stream.*;
import java.io.IOException;
class Test4
{

public static void main(String[] args){

System.out.println("Enter a number to find Factorialof it..");

int n=8 ;
n = (new

long result = (long) LongStream.rangeClosed(1, n)
.reduce( 1L, (a, b)-> a*b) ;

System.out.println(" Factorial of " +n+" = > " +result);




}
}

SUDSUDHIRKUMAR
Автор

amazing video you helped me in the right moment . Keep the good work

seewo
Автор

If number is 0 or if number is 1 then the factorial of numbers is??

vedharpatil
Автор

Sir I think you forgot System.out.print

technicalgaur
Автор

why you can't show the output i thing you are not a teacher

mdtausifasgar
welcome to shbcf.ru