+ 1
How can do this question By using array?
+ ++ +++ ++++ +++++ ++++++ +++++++ ++++++++ +++++++++ ++++++++++
8 Respuestas
+ 8
why not loop?
+ 7
These types of pyramids are made with loops :
+
++
+++
++++
And these types of pyramids are made with recursion : (can also use loops)
+
++
+++
++
+
Using array will be hard.
+ 7
@<Chinese words> Couldn't type your name.
Yes, If you want to use function thats easy. these types of functions are called recursion.
+ 2
Heres my shape generator if you want help.
https://code.sololearn.com/cN0J6M2BfXhF/#cpp
Ive added in comments to help fellow coders who want to try and understand my program. One of the shapes is a triangle if you want an idea on how to build one.
If you still want to make this by an array you can have a Dot_Count variable and increment the number after each row in the array has been filled and you use the Dot_Count variable to determine how many dots will go in that row of the array.
+ 1
why use array?
+ 1
store all + sign in array..
use same logic by loops..
only when you print * or + print here array element
+ 1
how can write program in function
0
by using function