C Program To Find Factorial of a Number using For Loop

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • technotip.com/7496/c-program-t...
    Write a C program to find Factorial of a user input number, using for loop.
    Example: Factorial of 5 is 120 (1 x 2 x 3 x 4 x 5 = 120).
    5! = 120 (It is read as 5 factorial is 120)
    C Programming Interview / Viva Q&A List
    technotip.com/6378/c-programmi...
    C Programming: Beginner To Advance To Expert
    technotip.com/6086/c-programmi...

КОМЕНТАРІ • 64

  • @ZeyExC
    @ZeyExC 3 роки тому +6

    Sir, Thank you for your tutorial💙

  • @kulvinderkaur9021
    @kulvinderkaur9021 2 роки тому +3

    Very nice teaching
    Thanks for teaching us

  • @p0p4
    @p0p4 2 роки тому +15

    you could enter ”count = 2” instead of ”count = 1” into the for() statement to skip the unnecessary first loop. Just something I noticed.
    The first loop simply just multiplies 1 with 1 after all.

    • @govindprajapat8171
      @govindprajapat8171 4 місяці тому

      But if you insert 1 in it then ? Means factorial of one❤

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

    Thank you sir this is very usefull for me

  • @STENOLOVER143
    @STENOLOVER143 3 роки тому +2

    Wow helpful video sir thanks

  • @chaitanya4525
    @chaitanya4525 2 роки тому +3

    Solved after 1 hour .thanks

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

    mashallaha bht acha smj aaa jta ha ap ka leacture☺☺☺☺☺☺

  • @nitisharma550
    @nitisharma550 9 місяців тому +1

    Thank you ❤

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

    Ty you saved me👍

  • @cmptr693
    @cmptr693 Рік тому +1

    It was helpful

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

    What happens when you enter 0?

  • @visheshchauhan633
    @visheshchauhan633 2 роки тому +6

    If i write 4 then how will i get the output like 4*3*2*1=24

  • @abhay-zw3yw
    @abhay-zw3yw Рік тому +1

    it doesnt work for large number , bcuz of size of integer . large number cant be store be integer data type

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

    When I type a no in terminal ..nothing happens.

  • @princesszoni
    @princesszoni 10 місяців тому

    How do I get it to print out all of the steps until it gets to the answer, for example 1: 1, 2: 2, 3: 6, the factorial of 4 is 24

    • @aswang444
      @aswang444 3 місяці тому

      #include
      int main()
      {
      int num, fact = 1;
      printf("Enter a number:
      ");
      scanf_s("%d", &num);
      for (int count = 1; count

  • @maliktasaduq5609
    @maliktasaduq5609 7 місяців тому

    My code isn’t working

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

    Why do 13 factorial and above become negative using this program?

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

      because here we are using int and we cannot store huge amount of data in int data type

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

    What if i didn't mention, fact= 1... What would it take as default value... ??

  • @user-wn1dc1fo5i
    @user-wn1dc1fo5i 3 місяці тому

    super

  • @NA7-DEVIL
    @NA7-DEVIL Рік тому +1

    Sir op promote us also please in community's post

  • @pexiepexie868
    @pexiepexie868 Рік тому +2

    I did 1k th like 🥳

  • @FREEFIRE-kp2kq
    @FREEFIRE-kp2kq 6 місяців тому +2

    ❤❤❤

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

    Can any one explian why we use
    ???

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

    Is this program work for c++

  • @user-wb9ve9cz3s
    @user-wb9ve9cz3s 2 місяці тому

    1 write algorithm
    2 Write (n=4 C program size 10 items.
    Use neutral language.
    Please help me with the video

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

    What's the name of c programming application?

  • @ffm_Nitish
    @ffm_Nitish 2 місяці тому

    🎉

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

    Declaration terminated incorrectly 😄

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

    Tumar program 2 howa nai karon 9,8 number bilakor factorial nulai.only 5,4,3,2 karone he program 2 right

  • @manabendrathakuria8830
    @manabendrathakuria8830 Рік тому +1

    If we find the factorial of 0, then your program displays the factorial 0 but the answer is 1

    • @SamuelBelinga
      @SamuelBelinga 9 місяців тому

      Factorial of 0 is 1
      And placing count from 0
      It will drop all other factorials to zero too
      I think, or I'm not getting it

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

    ok

  • @AmanChahal-rz6rs
    @AmanChahal-rz6rs 28 днів тому

    Count- - hona chie

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

    It gives wrong answer from factorial of 8

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

      Bcoz it is a long numbers

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

      @@monotheistAli do we hv to take long instead of int ?

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

      @@sania4310 yeah we should use "long int"

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

      @@monotheistAli thx

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

      @@sania4310 did it work tho, I am not working on C much

  • @zackcarl7861
    @zackcarl7861 3 роки тому +9

    Sir why assign 1 to fact

    • @p0p4
      @p0p4 2 роки тому +15

      Because 0 multiplied by anything is 0

    • @narlavarun8220
      @narlavarun8220 Рік тому +6

      Because if we don't assing an initial value it will take some garbage value as initial value

    • @souravjoshishorts7199
      @souravjoshishorts7199 Рік тому +2

      If we do i=n ; and i-- its possible?

    • @dhruvsapaliga6340
      @dhruvsapaliga6340 9 місяців тому

      Cause anything multiplied with 0 will be 0

    • @sagorbarua5775
      @sagorbarua5775 9 місяців тому

      Anything multiple 0 is 0 so if u didn't put 1 then the code will not start it will give result 0 no matter what value u put

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

    Urdu ma batao