CIW
1D0-437 · Question #4
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 t
Sign in or unlock 1D0-437 to reveal the answer and full explanation for question #4. The question stem and answer options stay visible for context.
Question
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?
Options
- AThe code will fail at line 1 because a hash cannot contain both numeric and string data.
- BThe code will execute without error but will output nothing.
- CThe will output the following 32oz 16oz 8oz
- DThe code will output the following large medium small
Unlock 1D0-437 to see the answer
You've previewed enough free 1D0-437 questions. Unlock 1D0-437 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.