Skip to content
doubtly

1 answer

#include<stdio.h>
#include<conio.h>
int fact(int);
int main()
{
 int x,n;
 clrscr();
 printf(" Enter the Number to Find Factorial :");
 scanf("%d",&n);
 x=fact(n);
 printf(" Factorial of %d is %d",n,x);
 return 0;
 getch();
}
int fact(int n)
{
 if(n==0)
 return(1);
 return(n*fact(n-1));
}
Doubtly · 13 Apr 2024 Report

Your answer

Log in or create a free account to answer this question.