cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Hash Pyramid with asterisk c++
Hash Pyramid with asterisk c++
Apr 14, 2016 at 4:23pm UTC
bear911
(2)
How to make this shape in c++ using for loop?
#####*#####
####*#*####
###*###*###
##*#####*##
#*#######*#
*#########*
Thanks
Apr 14, 2016 at 4:59pm UTC
MikeyBoy
(5631)
You're going to need to iterate over the six lines of the pattern.
You'll need to come up with some sort of algorithm to figure out where in any given line you need an asterisk, and where in each line you need a hash, based on the line number.
Apr 14, 2016 at 8:01pm UTC
bear911
(2)
Can you code it for better understanding?
Apr 14, 2016 at 10:54pm UTC
keskiverto
(10402)
In pseudo-code
for each line for each column in line if something then print * else print # print newline
Its your turn to write that in C++.
Topic archived. No new replies allowed.