Added exercise 4.18
[Cpp-Deitel-Exercises.git] / Chapter-4 / 4-18.cpp
blobde4396d1cf55d7e3339f82abbb0136686821aed3
1 /*C How to Program, 6/E, Deitel & Deitel.
3 Solution of exercise 4.18:
4 (Tabular Output) Write a C++ program that uses a while statement and the tab
5 escape sequence \t to print the following table of values:
7 N 10*N 100*N 1000*N
9 1 10 100 1000
10 2 20 200 2000
11 3 30 300 3000
12 4 40 400 4000
13 5 50 500 5000
15 Written by Juan Carlos Moreno (jcmhsoftware@gmail.com), 2023-01-19. */
17 #include <iostream>
19 using namespace std;
21 int main()
23 int N = 1;
25 cout << "N\t10*N\t100*N\t1000*N" << endl << endl;
27 while (N <= 5)
29 cout << N << "\t" << N*10 << "\t" << N*100 << "\t" << N*1000 << endl;
30 N = N + 1;
33 return 0;