0

Can we write pattern programming by recursion pls help me with an example

@ @@ @@@ @@@@ @@@@@ an example

1st Oct 2018, 1:23 PM
E.naraharireddy
E.naraharireddy - avatar
9 Answers
+ 4
Yes. All you need is a function that takes an integer as parameter (let's call it n) and prints n symbols in a row. Then the function calls itself recursively with n+1 until n is >= the desired maximum number of symbols (5 in your example)
1st Oct 2018, 2:27 PM
Anna
Anna - avatar
+ 3
Mohamed ELomari Technically, that's not a recursive function but a nested loop. And we're not supposed to post the solution before the op shows any attempt to write the code on their own đŸ€“
1st Oct 2018, 5:50 PM
Anna
Anna - avatar
+ 2
https://code.sololearn.com/cALUmzvc4S5Z/?ref=app ... respected madam here is my code ... iam getting output as ... @@@@@ @@@@ @@@ @@ @ .pls help madam ....
2nd Oct 2018, 3:45 PM
E.naraharireddy
E.naraharireddy - avatar
3rd Oct 2018, 12:19 AM
MO ELomari
MO ELomari - avatar
+ 1
Your code is actually pretty good. I just changed a couple of things https://code.sololearn.com/cdV8uvLhoiMQ/?ref=app
2nd Oct 2018, 4:07 PM
Anna
Anna - avatar
+ 1
tq so much madam ....
2nd Oct 2018, 4:09 PM
E.naraharireddy
E.naraharireddy - avatar
+ 1
You're welcome
2nd Oct 2018, 4:10 PM
Anna
Anna - avatar
0
respected madam i tried to get the code but its not executing properly pls help me by providing code if posible
2nd Oct 2018, 12:19 PM
E.naraharireddy
E.naraharireddy - avatar
0
Can you upload your code? I'll try to fix it
2nd Oct 2018, 2:59 PM
Anna
Anna - avatar