Server IP : 172.16.15.8 / Your IP : 3.139.98.10 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/kmmowery/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
//------------------------------------------------------ // // Name: Kieara Mowery // Date: Monday, October 27th, 2008 // Due : Wednesday, October 29th, 2008 // Purpose: To produce an N x N multiplication table // based on the requested size of the table. // //----------------------------------------------------- #include <iostream> #include <iomanip> using namespace std; int main() { int x, // Loop Counter Variable y, // Loop Counter Variable n; // Inputed value for size of table // Get the maximum value to display cout << "\n Enter the size of the multiplication fact table : "; cin >> n; while ( n < 2 || n > 20 ) { cout << "!!!! The size of the fact table must range from 2-20 !!!!"; cout << "\n Please re-enter the size of the fact table: "; cin >> n; } cout << setw( n )<< "\n" << n << " x " << n << " Multiplication Table " << endl; cout << " " ; for ( x = 1; x <= n; x++ ) { cout << setw(4) << x; } cout << setw(4) << "\n-----|"; for ( x = 1; x <= n; x++ ) { cout << setw(4) << "----"; } for ( x = 1; x <= n; x++ ) { cout << endl << setw(4) << x << " |"; for ( y = 1; y <= n; y++) cout << setw(4) << ( x * y); } cout << endl; cout << endl; return 0; }