Can any one help me solving this code by only recursion | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can any one help me solving this code by only recursion

***** ***** ***** ***** *****

2nd Oct 2018, 12:17 PM
E.naraharireddy
E.naraharireddy - avatar
6 Answers
+ 5
Write two recursive functions. They both have a count parameter. If their count is greater than zero, they call themselves with a count that is one less than theirs. Afterwards, the first one outputs a single '*'. The second one calls the first with a count of 4. The main program calls the second one with a count of 4 to start it all off.
2nd Oct 2018, 2:00 PM
John Wells
John Wells - avatar
+ 5
E.naraharireddy Seeing your problem was resolved already it would be great if you can mark the answer that you find useful to encourage the community to help each other out. 😉
3rd Oct 2018, 12:58 AM
Zephyr Koo
Zephyr Koo - avatar
+ 2
Compiles but doesn't run correctly. https://code.sololearn.com/c5619XW03Cd9 Compare it to yours to see what I did to fix your compile errors. Besides my comment on your code, you were missing many semicolon.
2nd Oct 2018, 5:26 PM
John Wells
John Wells - avatar
+ 2
tqs a lot sir ...... it runs correctly ..
2nd Oct 2018, 5:53 PM
E.naraharireddy
E.naraharireddy - avatar
+ 1
This one has minor changes to fix your logic errors. Compare it to see what was fixed. https://code.sololearn.com/ckmx3EQ2Zfhd
2nd Oct 2018, 5:49 PM
John Wells
John Wells - avatar
0
Where is your try?
2nd Oct 2018, 12:47 PM
KrOW
KrOW - avatar