A recursive function is a function which calls itself to work on the smaller function. This program reverses a string using a recursive function.
- class Program
- {
- static void Main(string[] args)
- {
- Program p = new Program();
- p.Fun();
- Console.WriteLine("\n");
- Console.ReadLine();
- }
- public void Fun()
- {
- char c;
- if ((c = Convert.ToChar(Console.Read())) != '\n')
- Fun();
- Console.Write(c);
- }
- }
- }
Hope you find this helpful.

Abubakr MahdiPosted Aug 8, 2019, 11:41 AM EDT
Its useful , thank you for the blog.
Pankajkumar PatelPosted Jul 31, 2019, 8:20 PM EDT
Good one ...