using System;
namespace ShortCircuit
{
class Program
{
static void Main(string[] args)
{
int x = 4;
int y = 5;
Console.WriteLine("x = {0}, y = {1}", x, y);
bool result = true || (++x == y);
Console.WriteLine("result = {0}", result);
Console.WriteLine("x = {0}, y = {1}", x, y);
result = true && (++x == y);
Console.WriteLine("result = {0}", result);
Console.WriteLine("x = {0}, y = {1}", x, y);
Console.ReadLine();
}
}
}
namespace ShortCircuit
{
class Program
{
static void Main(string[] args)
{
int x = 4;
int y = 5;
Console.WriteLine("x = {0}, y = {1}", x, y);
bool result = true || (++x == y);
Console.WriteLine("result = {0}", result);
Console.WriteLine("x = {0}, y = {1}", x, y);
result = true && (++x == y);
Console.WriteLine("result = {0}", result);
Console.WriteLine("x = {0}, y = {1}", x, y);
Console.ReadLine();
}
}
}