A recursive function is a function which calls itself to work on the smaller function. This program reverses a string using a recursive function.
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. Program p = new Program();
  6. p.Fun();
  7. Console.WriteLine("\n");
  8. Console.ReadLine();
  9. }
  10. public void Fun()
  11. {
  12. char c;
  13. if ((c = Convert.ToChar(Console.Read())) != '\n')
  14. Fun();
  15. Console.Write(c);
  16. }
  17. }
  18. }
Hope you find this helpful.