mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-05 14:25:37 +00:00
Initial commit
This commit is contained in:
parent
ca7684985d
commit
49bdd4dda1
60 changed files with 1527 additions and 30 deletions
27
vs4win/Chapter03/BooleanOperators/Program.cs
Normal file
27
vs4win/Chapter03/BooleanOperators/Program.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue