Multiple choice technology programming languages

$scalar = (10,20,30); print $scalar;

  1. 10

  2. 20

  3. 30

  4. 3

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Evaluating a list literal inside parenthesized syntax in a scalar context triggers the comma operator, which discards all but the last element. Thus, $scalar is assigned 30. Distractors like 10 or 3 assume array size or first-element behavior.