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<<>
#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<<>
Just Erase the Quotation in the Header File!
ReplyDelete