About Recursion

In order to understand recursion, one must first understand recursion.”

Read more: http://en.wikipedia.org/wiki/Recursion

And here is a C# program which prints its own source code as output:

class Quine {
  static void Main() {
    string f = "class Quine {{{2} static void Main() {{{2}  string f = {0}{1}{0};{2}  System.Console.WriteLine(f, (char)0x22, f, (char)10);{2}  }}{2}}}";
    System.Console.WriteLine(f, (char)0x22, f, (char)10);
  }
}

Found at: http://c2.com/cgi/wiki?QuineProgram

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s