Advertisement
Kulas_Code20

Multiplication Table

Oct 17th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int a[100][100];
  7.    
  8.     int num = 0;
  9.     cout<<"Multiplication Table"<<endl;
  10.     cout<<"Input the no. of rows and columns: ";
  11.     cin>>num;
  12.     cout<<endl;
  13.     for(int i=1;i<=num;i++){
  14.         for(int j=1;j<=num;j++){
  15.                 a[i][j] = (i)*(j);
  16.                 cout<< setw(5) << right <<a[i][j]<<"   ";
  17.         }
  18.         cout<<endl;
  19.     }
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement