diamond project

pls help me with my project i am a beginner in c++
how can i do this image

++++++++++
++++xxx++++
+++xxxxx+++
++xxxxxxxx++
+ xxxxxxxxxx+
++xxxxxxxx++
+++xxxxx+++
++++xx++++
++++++++++
ps:(Letter "X" is substitute for blanks)
thankyou in advance
Last edited on
not that one but thanks :) the letter X is only substitute for blanks or space.
Looking at that thread should give you some ideas about the kind of logic and techniques you can use to solve your problem. Obviously, you won't be able to use the same code, but you can learn from it and adapt it to achieve what you want.

We're not just going to do your homework for you.
What's your question? The thread to which the above link directs you to, has a few solutions to this problem.
Letter "X" is substitute for blanks

When you post here, there are formatting buttons that help adding tags around text. The code and output tags create monospaced output:
++++++++++
++++xxx++++
+++xxxxx+++
++xxxxxxxx++
+ xxxxxxxxxx+
++xxxxxxxx++
+++xxxxx+++
++++xx++++
++++++++++

The above is a copy-paste from your post, but in output tags. Is that exactly what you want, or does it have typos?

The main principle in diamond/triangle/pyramid programs is that you have a loop that on each iteration produces one line of the output. The loop counter provides a (line)number and that number is used to compute how many + or * or space the line must have.

Converting one number into text on line can involve one or more loops. They will be in the body of the outer loop. Nested.
Topic archived. No new replies allowed.