#include <stdio.h>
#include <conio.h>
// Recursive function to calculate factorial
int factorial(int n) {
if (n <= 1) {
return 1;
} else {
return n * factorial(n - 1);
}
}
int main() {
int number, fact;
// Input
printf("Enter a positive integer: ");
scanf("%d", &number);
// Function call and output
fact = factorial(number);
printf("Factorial of %d is %d", number, fact);
getch(); // Wait for user input to close the program
return 0;