Print Table using recurrsion c++

#include<iostream.h>
#include<conio.h>
int table ( int num , int num_1 )
{
    if ( num_1 == 1 )
    {
      cout<<num<<" x "<<num_1<<" = "<<num * num_1 << endl ;
     return 1 ;
    }
    else
    {
    table(num , num_1-1);
    cout <<num<<" x "<<num_1<<" = "<<num * num_1 << endl ;
    }   
}
int main ()
{
    int num , num_1;
    cout<<"\n PrograM to Print TabLe \n\n";
    cout<<"\n1. Starting Range : ";
    cin>>num;
    cout<<"\n2. Ending Range : ";
    cin>>num_1;
    cout<<"\n\n\n";
    table( num , num_1 );
    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