PROGRAM-11


// Programe of factorial  by using recursion                         
#include
#include
int fact(int );
void main()
{
 clrscr();
 int n,j;
 printf("enter a number");
 scanf("%d", &n);
 printf(" the factorial of the number %d is %d ",n,fact(n));
 getch();
}
 int fact(int n)
 {
 int result;
 if(n==0)
 result=1;
 else
 result=n*fact(n-1);
 return (result);
}



Algorithm

·                     Start
·                     Declare n, j as integer
·                     Write("the number")
·                     Read("the number”)
·                     Read(" the factorial of the number”)
·                     Stop
·                     Declare fact(int n), result as integer
·                     if(n==0)
·                     result=1
·                     else
·                     result=n*fact(n-1)
·                      return (result)

#vpsinghrajput

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

1 comments: