Write a recursive function that returns a string and that takes 1 string parameter. Each invocation of the function should concatenate the string parameter to itself. So, if the string "duck" was passed in, it should return the string "duckduck". The recursion should stop when the length of the string exceeds 100.
Recursive Function
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Feb 14, 2014, 7:46 AM EST
Try:
using System; class Program { static void Main() { string s = "duck"; s = Concatenate(s); Console.WriteLine(s); Console.ReadKey(); } static string Concatenate(string s) { while (s.Length <= 100) { s = Concatenate(s + s); } return s; } }