Frequently Asked Java Program 13: Factorial of a Number

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 27

  • @2anshumansehgal
    @2anshumansehgal 5 років тому +6

    Thanks sir a lot...really liked the series..please make array set of questions as well. Thanks

  • @KrisuParikh
    @KrisuParikh 6 днів тому

    thank you so much , ur videos means a lot

  • @kennyi1200
    @kennyi1200 2 роки тому +1

    Recursion would go as well public static long factorial(int number) { if(number>=1) return number*factorial(number-1); else return 1; } and SysOut factorial(5);

  • @hemmishra1102
    @hemmishra1102 2 роки тому +5

    //using while loop
    import java.util.Scanner;
    public class FactorialOfANumber {
    public static void main(String[] args) {
    System.out.println("Enter a number :");
    Scanner sc=new Scanner(System.in);
    int num;
    num=sc.nextInt();
    int number=num;
    int res=1;
    while (num>0)
    {
    res=res*num;
    num--;
    }
    System.out.println("Factorial of "+number+" is: "+res);
    }
    }

  • @sanjayyadav-xe7mf
    @sanjayyadav-xe7mf 2 роки тому +1

    very simple explanation...thaanks a lot sir

  • @RamisettyKalpana-jy7jb
    @RamisettyKalpana-jy7jb 5 місяців тому +1

    Thank you sir

  • @nickthelover1
    @nickthelover1 4 роки тому +4

    Good explanation. But did not cover while loop

  • @kogilathotavijayreddy4963
    @kogilathotavijayreddy4963 2 роки тому

    Find factorial of a big number using Big integer class..... because if we do using int for big numbers it will stack overflow

  • @samitasajeevan2659
    @samitasajeevan2659 3 роки тому +1

    Wonderful ❤️

  • @roshaniagrahari5640
    @roshaniagrahari5640 3 роки тому +1

    Very nice

  • @gauri992
    @gauri992 3 роки тому +1

    Thankyou Sir

  • @anandsharma9159
    @anandsharma9159 3 роки тому

    Could have explained recursive solution as well. Mostly interviewers look for that.

  • @r.rajalakshmi369
    @r.rajalakshmi369 9 місяців тому

    Sir, Debugging video pls.

  • @bommanareddaiah3950
    @bommanareddaiah3950 2 роки тому +1

    Sir reversing number lo scanner.ani yenduku vachhindi bro

  • @madhukiransunkara9807
    @madhukiransunkara9807 5 років тому

    Sir Make an video about ISTQB Fundamental level certification Details and How to prepare for it

  • @pavankukatlapalli
    @pavankukatlapalli 5 місяців тому

    How to remove the debug point?

  • @NA7-DEVIL
    @NA7-DEVIL 2 роки тому +1

    Sir thank you God is great Sir op promote us also please in community's post

  • @AyushDadweOfficial
    @AyushDadweOfficial Рік тому

    sir you look like harshad mehtaa 😳

  • @niteshwar1714
    @niteshwar1714 Рік тому

    public class Main
    {
    public static void main(String[] args) {
    int num=5;
    long fact=1;
    while(num!=0){
    for(int i=1;i

    • @lekhyasagala
      @lekhyasagala Рік тому

      Write your print out statement outside the while loop

  • @neelmoradiya1389
    @neelmoradiya1389 Рік тому

    🇮🇳🇮🇳🙏🙏👍👍