If Any Required Program Please Ask In Comment I Will Help You(any Program in JAVA or C++) . . THANKS FOR VISITING MY BLOG!

If U LIKE MY PROFILE RAISE YOUR HAND IF U NOT RAISE UR STANDARD. Powered by Blogger.

Sunday, October 21, 2018

PROGRAM FOR TABLE OF NUMBER using RECURSION.



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

using namespace std;

int Table(int A, int B);

int main()
{
    int I = 1 ,No;

    cout << "Enter Any Number: ";
    cin >> No;

    cout << "\nThis is a Function returning Value: " << Table(No, 10) <<endl;

    getch();
    return 0;
}

int Table(int A, int B)
{
    if(B == 1)
    {
        cout << A << " * " << B << " = " << A * B << endl;
        return 1;
    }

    Table(A, B-1);
    cout << A << " * " << B << " = " << A * B << endl;

    return 25;
}

0 comments:

Post a Comment