Join the social network of Tech Nerds, increase skill rank, get work, manage projects...

• # Program for factorial of a number using recursive function in C

• 0
• 0
• 0
• 0
• 0
• 0
• 0
• 0
• 335
Comment on it

What is Factorial ?

Factorial of a no. means multiplying below numbers. Factorial is denoted by ! Exclamation mark
Eg:- 5! means :- 5 * 4 * 3 * 2 * 1 = 120

What is a Recursive function?

Definition:- A function which calls itself is called as Recursive function & technique is called as Recursion

Program for factorial of a number using recursive function in C

```#include<stdio.h>
#include<conio.h>
int fn(int n);
void main()
{
int num, f;
clrscr();
// Enter the number for factorial
printf(\n Enter the number:-);
scanf(%d, num);
f=fn(num);
printf(\n The Factorial number:-%d,f);
getch();
}
int fn(int n)
{
int y;
if ((n==0)||(n==1))
y=1;
else
y=n*fn(n-1);
return(y);
}
```

Output:-

```Enter the number:- 5
The Factorial number:- 120
```

## 0 Comment(s)

OR
OR
Register

OR
Fill out the form below and instructions to reset your password will be emailed to you:
Fill out the form below and reset your password:

• Hire
• Post Projects

### Post Projects

• All at 0 Cost ....
• Post Tech Job
• Select Best Bidder
• Track the Project
• Approve Work and Pay safely
• Browse Nerds
• Work
• Find Projects Find Projects
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Manage
• Company Company

### Manage Company

• All at 0 Cost ....
• Manage Company and Employee Profiles
• Use Online Project Management Tools for Free
• Company wide Employee Productivity Reports
• Knowledge Sharing and Collaboration Tools
• Get Sales Lead and Bid for Tech Projects
• Send Invoices and Receive Payment Safely
• Learn
• Nerd Digest Nerd Digest
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Tech Q & A Tech Q & A
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Record & Share

### Desktop Recording Tool

• All at 0 Cost ....
• Online tool for Recording Desktop Activity and Audio
• Store and Share from the Cloud
• Creating Software Product Demos
• Creating video tutorials
• Recording and Reporting Software and Project issues as videos
• Ask Tech Query
• Post Blogs