Experiment_27_AS
Experiment_27_AS
Objective:
To write a program to ind the factorial of a number using recursion.
Introduction:
This experiment involves using recursion to compute the factorial of a number.
Algorithm:
1. Start the program.
Code:
#include <stdio.h>
int factorial(int n) {
if(n == 0)
return 1;
else
}
f
int main() {
int num;
scanf("%d", &num);
return 0;
Output:
Result:
The program calculates the factorial using recursion.