Q2 Write a c program to find the factorial value of any number entered through the keyboard.

Program: 95

Write a c program to find the factorial value of any number entered through the keyboard.

Output:

 Enter a number: 5
 The Factorial for 5 is 120

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

3 thoughts on “Q2 Write a c program to find the factorial value of any number entered through the keyboard.

  • June 15, 2020 at 12:07 pm
    Permalink

    why you put conio.h in every program

    Reply
    • June 15, 2020 at 4:29 pm
      Permalink

      Some old compilers doesn’t support console input/Output without conio.h header files. It’s not a part of standard library.
      It’s my habit, you can ignore it because modern compiler doesn’t need conio.h.
      and Thanks for choosing EasterScience

      did you checked our COVID-19 Tracker

      Reply
  • January 31, 2021 at 12:01 pm
    Permalink

    //it can be done in this way also?
    #include<stdio.h>
    main()
    {
    int num,i,n=1;
    printf(“enter a number”);
    scanf(“%d”,&num);
    for(i=1;i<=num;i++)
    {
    n=n*i;
    }
    printf(“fectorial is %d”,n);
    }

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.