+ 1

How can do this question By using array?

+ ++ +++ ++++ +++++ ++++++ +++++++ ++++++++ +++++++++ ++++++++++

23rd Apr 2017, 9:49 AM
Bts...
Bts... - avatar
8 Answers
+ 8
why not loop?
23rd Apr 2017, 10:07 AM
Agus Mei
Agus Mei - avatar
+ 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.
23rd Apr 2017, 10:17 AM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 7
@<Chinese words> Couldn't type your name. Yes, If you want to use function thats easy. these types of functions are called recursion.
23rd Apr 2017, 10:19 AM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 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.
23rd Apr 2017, 5:18 PM
Ty Ler
Ty Ler - avatar
+ 1
why use array?
23rd Apr 2017, 10:06 AM
CalviŐČ
CalviŐČ - avatar
+ 1
store all + sign in array.. use same logic by loops.. only when you print * or + print here array element
23rd Apr 2017, 10:20 AM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 1
how can write program in function
23rd Apr 2017, 10:26 AM
Bts...
Bts... - avatar
0
by using function
23rd Apr 2017, 10:18 AM
Bts...
Bts... - avatar