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?

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?

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.



Leave a Reply 1

Your email address will not be published. Required fields are marked *