Program for Finding Factorial of a given number using Recursion

#include<stdio.h>
#include<conio.h>
fact ( int n);
main( )
{
int n, r;
printf (“enter a value “);
scanf (“/d”,&n);
r=fact(n);
printf (“factorial is % d “,r);
}
fact ( int n)
{
If (n==1)
return 1;
else
return ( n*fact (n–1));
}

Out Put:

Enter n value 5                                

Factorial is 120                                 

Related

C Programs 2625421769194474389

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item