Advertisement
payjack

why

Nov 2nd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. //Multiplication Table
  2. //Olivia Pagach pd2A
  3. //November2 2017
  4.  
  5. #include <iostream>
  6. #include <cmath>
  7. #include <iomanip>
  8. using namespace std;
  9.  
  10. int getInput ()
  11.     {
  12.         cout<<"Where do you want the multiplication table to stop?"<<endl;
  13.         int x;
  14.         cin>>x;
  15.         return x;
  16.     }
  17.  
  18.  
  19. int main ()
  20.  
  21. {
  22.  int x= getInput ();
  23.  
  24.      for (int i = 1; i<= x; i++)
  25.      {
  26.  
  27.  
  28.           for(int j = 1; j <= x; j++)
  29.           {
  30.           cout <<setw(5)<< j * i << '\t';
  31.           }
  32.           cout << endl;
  33.      }
  34.      return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement