-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01.04.print_a_table.cpp
29 lines (24 loc) · 1.17 KB
/
01.04.print_a_table.cpp
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
#include <iostream>
using namespace std;
// --------------------
// 1.4. Print a Table.
// by : Putra
// --------------------
int main() {
cout << "Table. The Product of 5 and 10." << endl;
cout << "==========================" << endl;
cout << "| " << "p" << " | " << "p * 5" << " | " << "p * 10" << " |"<< endl;
cout << "--------------------------" << endl;
cout << "| " << 5 << " | " << 5 * 5 << " | " << 5 * 10 << " |" << endl;
cout << "| " << 10 << " | " << 10 * 5 << " | "<< 10 * 10 << " |" << endl;
cout << "| " << 15 << " | " << 15 * 5 << " | " << 15 * 10 << " |" << endl;
cout << "| " << 20 << " | " << 20 * 5 << " | " << 20 * 10 << " |" << endl;
cout << "| " << 25 << " | " << 25 * 5 << " | " << 25 * 10 << " |" << endl;
cout << "==========================" << endl;
return 0;
}
/*
Source :
Liang. 2014. Introduction to Programming with C++ 3rd Edition. London : Pearson Education.
https://www.pearson.com/en-us/subject-catalog/p/Liang-Companion-Website-for-Introduction-to-Programming-with-C-Access-to-Videonotes-3rd-Edition/P200000003422/9780133380262
*/