-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNestedLoopsMultiplcationTableDEMO.cpp
More file actions
38 lines (30 loc) · 1.02 KB
/
Copy pathNestedLoopsMultiplcationTableDEMO.cpp
File metadata and controls
38 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//************************************************************************
// Author: Rolando Carreon
// Date: feb 25 2025
// Language: C++
// Assignment: NestedLoopsMultiplicationTableDEMO
// Description: display the multiplacation table
//************************************************************************
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
// declare local variables
int row, col;
//display the table header
cout << " | 1 2 3 4 5 6 7 8 9 10\n"
<< "---------------------------------------------------\n";
// for each row, 1-10, display the multplication facts
for (row = 1; row <= 10; row++)
{
// display the multiplcation value
cout << setw(2) << row << " | ";
// for each col, 1-10, display the specific multiplaction fact
for( col = 1; col <= 10; col++)
cout << setw(4) << row * col;
// go to the next row
cout << endl;
}
return 0;
}