Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void menu(int &c);
- void inputmul(int num[5][12]);
- void calMulTable(int num[5][12]);
- void showMulTable(int num[5][12]);
- int main()
- {
- int c;
- int num[5][12];
- do{
- menu(c);
- switch(c)
- {
- case 1 : inputmul(num);
- break;
- case 2 : calMulTable(num);
- break;
- case 3 : showMulTable(num);
- break;
- }
- }while(c!=0);
- cout<<"Exit Program"
- }
- void menu(int &c)
- {
- cout<<"///////////////////////////// Multiplication Table ///////////////////////////////"<<endl;
- cout<<"Press 1 : input MUL"<<endl;
- cout<<"Press 2 : Calc MUL To table"<<endl;
- cout<<"Press 3 : Show Mul Table"<<endl;
- cout<<"Press 0 : Exit"<<endl;
- cout<<"///////////////////////////////////////////////////////////////////////////////"<<endl;
- cout<<"Enter Menu : ";
- cin>>c;
- }
- void inputmul(int num[5][12])
- {
- cout<<"///////////////////////////// Inpujt MUL//////////////////////////////"<<endl;
- for(int r=0;r<5;r++)
- {
- cout<<"Enter No "<<r+1<<" :";
- cin>>num[r][0];
- }
- }
- void calMulTable(int num[5][12])
- {
- for(int r=0;r<5;r++)
- {
- for(int c=1;c<12;c++)
- {
- num[r][c]=(num[r][0])*(c+1);
- }
- }
- }
- void showMulTable(int num[5][12])
- {
- cout<<"///////////////////////// Multipilcation Table ///////////////////////////"<<endl;
- for(int i=1;i<=10;i++)
- {
- cout<<i<<"\t";
- }
- cout<<endl;
- cout<<"--------------------------------------------------------------------------"<<endl;
- for(int r=0;r<5;r++)
- {
- for(int c=0;c<12;c++)
- {
- cout<<num[r][c]<<"\t";
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement