#include<iostream>
using namespace std;
int table (int number , int n); // prototype
int main(){
int number ;
cout<<"Please enter Number for which you want to print table : ";
cin>>number;
table(number , 10); // function calling and passing number and
//numbers of multiples(in this case up to 10th
// multiple)
return 0;}
int table (int number , int n){
if(n == 1)
{
cout<<number<<" * "<<n<< " = "<<number*n<<endl;
return 1;
}
table(number , n-1); // recursive calling
cout<<number<<" * "<<n<< " = "<<number*n<<endl;
return 1;
}
using namespace std;
int table (int number , int n); // prototype
int main(){
int number ;
cout<<"Please enter Number for which you want to print table : ";
cin>>number;
table(number , 10); // function calling and passing number and
//numbers of multiples(in this case up to 10th
// multiple)
return 0;}
int table (int number , int n){
if(n == 1)
{
cout<<number<<" * "<<n<< " = "<<number*n<<endl;
return 1;
}
table(number , n-1); // recursive calling
cout<<number<<" * "<<n<< " = "<<number*n<<endl;
return 1;
}
<by m.ali>
No comments:
Post a Comment