From 17513dd40d00142f06c85aa01e12e01ddb24581a Mon Sep 17 00:00:00 2001 From: JCMH1981 Date: Mon, 3 Jan 2022 20:45:22 -0500 Subject: [PATCH] Added exercise 2.21 --- Chapter-2/2-21.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Chapter-2/2-21.cpp diff --git a/Chapter-2/2-21.cpp b/Chapter-2/2-21.cpp new file mode 100644 index 0000000..54cb27c --- /dev/null +++ b/Chapter-2/2-21.cpp @@ -0,0 +1,26 @@ +/* C++ How to Program, 9/E, by Paul Deitel & Harvey Deitel. + +Solution of exercise 2.21: +(Displaying Shapes with Asterisks) Write a program that prints a box, an oval, +an arrow and a diamond as follows: + +Written by Juan Carlos Moreno (jcmhsoftware@gmail.com), 2022/01/03 */ + +#include + +using namespace std; + +int main() +{ + cout << "********* *** * *" << endl; + cout << "* * * * *** * *" << endl; + cout << "* * * * ***** * *" << endl; + cout << "* * * * * * *" << endl; + cout << "* * * * * * *" << endl; + cout << "* * * * * * *" << endl; + cout << "* * * * * * *" << endl; + cout << "* * * * * * *" << endl; + cout << "********* *** * *" << endl; + + return 0; +} -- 2.11.4.GIT