Tuesday, February 10, 2009

Simple Factorial Using Recursive Function


Here is my simple Recursive Factorial Function.

#include <"iostream">
#include <"conio.h">

using namespace std;

int factorial(int f)
{
if(f==1)
return 1;
else
f = f * factorial (f-1);
return f;
}

int main()
{
int a, b;
cout<<"Enter the Number: "; cin>>a;
b = factorial(a);
cout<<"The Factorial is: "; cout<<>

1 comment: