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