OneCompiler

Print ing the table of the number given by user.

1642

#include<iostream>
using namespace std;

int inp(int &i1,int &i2)
{
  cout <<"Enter the number for which you need table= ";
  cin>>i1;
  cout <<"Enter the number upto which you need table= ";
  cin>>i2;
  return i1;
  return i2;
}

void tab(int tn,int un)
{
short i=1;
short p=0;
while(i<=un)
{p=i*tn;
cout << tn<<" * " << i << " = " << p << endl;
i++;
}
}
int main()
{
int a; int b;again:
inp(a,b);
tab(a,b);
short con;
cout <<"Do you want to continue(1/0) = ";
cin>>con;
switch (con)
{
case 1:goto again;
break;
case 0:cout <<"Thank you";
break;
default :cout <<"Error input ";
break;

 }

return 0;
}