|
This post originated from an RSS feed registered with .NET Buzz
by Eric Gunnerson.
|
Original Post: Two posers for you
Feed Title: Eric Gunnerson's C# Compendium
Feed URL: /msdnerror.htm?aspxerrorpath=/ericgu/Rss.aspx
Feed Description: Eric comments on C#, programming and dotnet in general, and the aerodynamic characteristics of the red-nosed flying squirrel of the Lesser Antilles
|
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Eric Gunnerson
Latest Posts From Eric Gunnerson's C# Compendium
|
|
What is the output of the following code, and why?
class Test
{
public static void Main()
{
int z = 2;
z += ++z+5*z++;
System.Console.WriteLine("Yak! {0}", z);
}
}
What about this code?
class Test
{
public static void Main()
{
int z = 2;
z += (5*z++)+(++z);
System.Console.WriteLine("Yak! {0}", z);
}
}
Extra credit: What is the defined output for C++, and why?
Read: Two posers for you