Initialize array in one line / in a single statement
C#
22
Posts
8
Posters
1
Views
1
Watching
-
I actually used the following statement
string str = new string('*', 10)
That doesn't meet the stated criteria.
-
Hi, recursion is not always the way.
*
*
*
**
***
*****
********If I were to generate and display the following, you will observe that when n= 50, program hangs. the number of times recursive method gets called grows exponentially. In such a case a non recursive method is required. Regards, NetQuestions
Indeed, I'm well aware of such. I was only basing my suggestion on the fact it seemed like a homework assignment to create a recursive method. :)