mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
27 lines
750 B
C#
27 lines
750 B
C#
bool a = true;
|
|
bool b = false;
|
|
WriteLine($"AND | a | b ");
|
|
WriteLine($"a | {a & a,-5} | {a & b,-5} ");
|
|
WriteLine($"b | {b & a,-5} | {b & b,-5} ");
|
|
WriteLine();
|
|
WriteLine($"OR | a | b ");
|
|
WriteLine($"a | {a | a,-5} | {a | b,-5} ");
|
|
WriteLine($"b | {b | a,-5} | {b | b,-5} ");
|
|
WriteLine();
|
|
WriteLine($"XOR | a | b ");
|
|
WriteLine($"a | {a ^ a,-5} | {a ^ b,-5} ");
|
|
WriteLine($"b | {b ^ a,-5} | {b ^ b,-5} ");
|
|
|
|
WriteLine();
|
|
WriteLine($"a & DoStuff() = {a & DoStuff()}");
|
|
WriteLine($"b & DoStuff() = {b & DoStuff()}");
|
|
|
|
WriteLine();
|
|
WriteLine($"a && DoStuff() = {a && DoStuff()}");
|
|
WriteLine($"b && DoStuff() = {b && DoStuff()}");
|
|
|
|
static bool DoStuff()
|
|
{
|
|
WriteLine("I am doing some stuff.");
|
|
return true;
|
|
} |