Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. //program that computes a multiplication table, basic formatting or
  6.  
  7. int main() {
  8.  
  9. int x,y;
  10. int result = 0;
  11.  
  12. cout<< "Enter a number to multiply: ";
  13. cin >> x;
  14.  
  15. cout << "Enter another number to multiply: ";
  16. cin >> y;
  17.  
  18.  
  19.  
  20. for(int i=1; i<=x; i++) {
  21.  
  22. cout << setw(5) << i;
  23.  
  24. for(int j=1; j<=y; j++) {
  25.  
  26. cout << setw(5)<< i*j;
  27.  
  28. }
  29. cout << endl;
  30. }
  31.  
  32.  
  33.  
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement