#include<stdio.h>
#include<conio.h>
int
rfact(int n)
{
if(n==0)
return 1;
else if(n==1)
return 1;
else
return n*rfact(n-1);
}
void
main()
{
int n;
clrscr();
printf("Entre any numbr-\n");
scanf("%d",&n);
if(n<0)
printf("The number is negetive
\n");
else
printf("The factorial of
%d=%d",n,rfact(n));
getch();
}
No comments:
Post a Comment