Professional Documents
Culture Documents
Printing Different Symbols (One With, $ and Other With @, #)
Printing Different Symbols (One With, $ and Other With @, #)
Write a ready-for-compilation C++ program to generate shape as shown in output window for
depth N (N is given by user). Notice that, two triangles are generated, with alternate rows
printing different symbols (one with *, $ and other with @, #). If executed, the output window of
your program may be as follows:
RUN-1:
==========
Enter the depth: 5
* @ @ @ @ @
$ $ # # # #
* * * @ @ @
$ $ $ $ # #
* * * * * @
Press any key to continue
RUN-2:
============
Enter the depth: 7
* @ @ @ @ @ @ @
$ $ # # # # # #
* * * @ @ @ @ @
$ $ $ $ # # # #
* * * * * @ @ @
$ $ $ $ $ $ # #
* * * * * * * @
Press any key to continue