A Little .Net Puzzle

This innocent little puzzle formed from some of the recent code I was writing. Lets see if it gets you!

object p = 2;
object q = p;
p = 4;
System.Diagnostics.Debug.WriteLine("Answer is " + q.ToString());

Meanwhile I’m having fun asking it to my colleagues 😉

Avatar
Shital Shah

A program trying to understand what it’s computing.

comments powered by Disqus