Print Factorial of number using recursion c++

#include<iostream.h>
#include<conio.h>
#include<fstream.h>
int fact ( int n )
{
    if ( n==1 )
    return 1 ;
    else
    return n*fact( n-1);   
}
int main ()
{
    int num ;
    cout<<"\n\n Enter The Number : ";
    cin>>num;
    cout<<"\n\n\n\t\t FactoriaL : "<< fact( num );
    cout<<"\n\n\n";
}
SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment