Hash Pyramid with asterisk c++

How to make this shape in c++ using for loop?

#####*#####
####*#*####
###*###*###
##*#####*##
#*#######*#
*#########*

Thanks

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.
Can you code it for better understanding?
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.