Education & Competitive Exam

Factorial Program in C / Find factorial using Recursion

Read the important current affairs of 15 July 2026 for SSC, Banking, UPSC, Railway and all competitive exams.

8 Jul 2024 5 Min Read Quizer Team 685 Views
Factorial Program in C / Find factorial using Recursion

08

July 2024

C Program to find factorial of a number using recursion

What is Factorial?

In Mathematics, factorial is a simple thing. Factorials are just products. An exclamation mark indicates the factorial. Factorial is a multiplication operation of natural numbers with all the natural numbers that are less than it. In this article, let’s discuss the factorial definition, formula and examples.

The formula to find the factorial of a number is

n! = n × (n-1) × (n-2) × (n-3) × ….× 3 × 2 × 1

Factorial of 10

For example, the factorial of 10 is written as

10! = 10 (9 × 8 × 7 × 6 × 5× 4 × 3 × 2 × 1)

Therefore, the value of 10 factorial is 3,628,800


How to find factorial in C using loog

    #include  
    int main()    
    {    
     int i,fact=1,number;    
     printf("Enter a number: ");    
      scanf("%d",&number);    
        for(i=1;i<=number;i++){    
          fact=fact*i;    
      }    
      printf("Factorial of %d is: %d",number,fact);    
    return 0;  
    }  

Find factorial in C using Recursion

#include
int main(){
int n;
long int fact(int n);
printf("Enter Your number :");
scanf("%d",&n);

printf("The factorial of %d is %ld",n,fact(n));
return 0;
}

long int fact(int n){
       if(n>=1){
             return n*fact(n-1);
        }else{
             return 1;
       }
}

OUTPUT :

Enter a number: 5
Factorial of 5 is: 120


CONCLUSION :

There are multiple methods to calculate the factorial of a number in C. Whether it's using an iterative solution, recursion, the tgamma() method, or pointers, the most suitable method will depend on the specific needs of your program.




Why Quizer.in is Important?

Quizer.in is your complete one-stop platform for daily current affairs, interactive quizzes, and exam-focused study material. Whether you are preparing for SSC, Banking, Railway, UPSC, State PSC or Teaching exams, regular practice on Quizer.in helps you:

  • Stay updated with the latest current affairs
  • Improve accuracy and speed through daily quizzes
  • Strengthen your General Awareness section
  • Build consistency and stay ahead of the competition
Quizer Team
About the Author

Quizer Team

Passionate about current affairs, competitive exams, and helping aspirants succeed.

📢 Join Our WhatsApp Channel

Get Daily GK, Current Affairs, Amazing Facts & Quiz Updates.

🚀 Join Now

Comments (0)

No comments yet — be the first to comment! 💬

Leave a Comment

Your email address will not be published. Required fields are marked *

Stay Updated!

Subscribe to receive daily Current Affairs, Exam Tips and Government Job updates.

Join Monthly Challenge

Compete, Learn & Win exciting prizes.

  • Cash Rewards
  • E-Certificates
  • Leaderboard Ranking
  • Daily Practice
Join Now

Related Blogs

View All
Education & Competitive Exam
SSC Exam – Complete Guide for Smart Preparation (2025–2026)
23 Dec 2025 1963
Read More
Education & Competitive Exam
Scholarship Opportunities for Indian Students in 2025
16 Jul 2025 1554
Read More
Education & Competitive Exam
Life After Graduation: Navigating the Next Chapter
28 Aug 2024 1480
Read More