**Factorial using recursion in c:** To find factorial using recursion is a simple program to find factorial of a number.

**Recursion in c :**

Function calling itself is referred to as recursion.

**What is factorial?**

The factorial is the product of all numbers less than or equal to N but greater than or equal to 1.

The factorial value of 0 is defined as equal to 1.

**Factorial formula:**

N! => N*(N-1)*(N-2)….

## Algorithm to find factorial using recursion in c

- Declare the factorial function.
- Write the main function.
- Declare variables.
- Take an input number from the user.
- Pass number to the factorial function.
- Define factorial function (write recursive code to find factorial of a number)
- Print factorial

## Program for factorial using recursion

#include<stdio.h> long factorial(int); int main() { int n; long f; printf("Enter an integer to find its factorial\n"); scanf("%d", &n); if (n < 0) printf("Factorial of negative integers isn't defined.\n"); else { f = factorial(n); printf("%d! = %ld\n", n, f); } return 0; } long factorial(int n) { if (n == 0) return 1; else return(n * factorial(n-1)); }

**Output :**