Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Logical-operations/Perl/logical-operations.pl
Normal file
13
Task/Logical-operations/Perl/logical-operations.pl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
sub show_bool
|
||||
{
|
||||
return shift() ? 'true' : 'false', "\n";
|
||||
}
|
||||
|
||||
sub test_logic
|
||||
{
|
||||
my ($a, $b) = @_;
|
||||
print "a and b is ", show_bool $a && $b;
|
||||
print "a or b is ", show_bool $a || $b;
|
||||
print "not a is ", show_bool !$a;
|
||||
print "a xor b is ", show_bool($a xor $b);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue