CIW
1D0-437 · Question #19
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…
The correct answer is C. The code will output the following. See the full explanation below for the reasoning.
Question
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?
Options
- AThe code will output the following
- BThe code will output the following
- CThe code will output the following
- DThe code will output the following
How the community answered
(38 responses)- A8% (3)
- B3% (1)
- C84% (32)
- D5% (2)
Community Discussion
No community discussion yet for this question.