Can anyone help me how can we print our name 10 times using the recursion function in C?
Firstly, welcome to the forums.
While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too.
With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).
It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.
Please provide some example of what you’ve tried and I’m sure you’ll get more help.
I would start by just writing out the logic of the function in plain English (or whatever language you prefer). What arguments would the function need to take in order to write your name out a certain number of times? A recursive function has a base case and a recursive call. What is the base case? How would you call the function recursively if you haven’t reached the base case?
You don’t need to write this out in C (or any other programming language) for now. You just need to understand how it would work first and then you can implement it in whatever language you prefer.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.