PrepAway - Latest Free Exam Questions & Answers

What is the result of executing this program code?

Consider the following program code
package Dog;
$string = “Walk the dog.”;
if($string eq “Walk the dog.”)
{
package Cat;
$string = “Pet the cat.”;
print(“$string\n”);
}
print (“$string\n”);
What is the result of executing this program code?

PrepAway - Latest Free Exam Questions & Answers

A.
The code will output the following
Pet the cat.
Pet the cat.

B.
The code will output the following
Walk the dog.
Walk the dog.

C.
The code will output the following
Pet the cat.
Walk the dog.

D.
The code will output the following
Walk the dog.
Pet the cat.

One Comment on “What is the result of executing this program code?


Leave a Reply