Horje
factorial using recursion cpp Code Example
factorial using recursion cpp
#include <iostream>
using namespace std;

int fact(int n);

int main()
{
    int n;
    cout<< "Enter the number: ";
    cin>> n;

    cout<< "Factorial of " <<n <<" is " <<fact(n);

}

int fact(int n)

{
    if (n>=1)
        return n*fact(n-1);
    else
        return 1;
}




Cpp

Related
get current directory cpp Code Example get current directory cpp Code Example
C++ linked list iterator Code Example C++ linked list iterator Code Example
rgb type def Code Example rgb type def Code Example
what is 10 + (-4) Code Example what is 10 + (-4) Code Example
C++ programming code to remove all characters from string except alphabets Code Example C++ programming code to remove all characters from string except alphabets Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9