Consider the following program code:
1.$x = 100;
2.$y = "-25";
3.$sum = $x + $y;
4.
5.print $sum;
What is the result of executing this program code?
Answer : B
Consider the following program code:
$x = 150;
$y = "250";
if (($x + 100) == $y) { print("1 "); }
if ("250" == $y) { print("2 "); }
if ("250" eq $y) { print("3 "); }
if ($x lt $y) { print("4 "); }
if ($x ge $y) { print("5 "); }
What is the result of executing this program code?
Answer : A
Consider the following program code:
1.$x = 100;
2.$y = 15;
3.$result = $x % $y;
4.
5.print$result;
What is the result of executing this program code?
Answer : C
Consider the following program code:
$x = 5;
$y = 10;
while(++$x < 10 && ++$y < 15)
{
print ($x $y );
}
print ($x $y );
What is the result of executing this program code?
Answer : B
Consider the following program code
%hash = ("small" -> "Boz",
"medium" => "16oz",
"large" => "32oz");
@keys = sort(keys(%hash));
for ($i = 0; $i < 3; $i++) {
print("$hash{$keys[$i]}\n");
}
What is the result of executing this program code?
Answer : C
Which of the following choices demonstrates the correct syntax to pass the argument $arg2 to the subroutine getpass?
Answer : A
Consider the following package definition package Convert;
Which one of the following statements should immediately follow the given package definition to create a valid module?
Answer : A