Multiple choice technology programming languages

@array = (100, 80, 70); @sort_arr = sort(@array); print @sort_arr;'

  1. 70 80 100

  2. 100 80 70

  3. 100 70 80

  4. 1 2 3

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

By default, Perl's sort function performs a standard ASCII-betical (lexicographical) comparison. When sorting the strings '100', '80', and '70', '100' comes first because its leading character '1' is ASCII-ordered before '7' and '8', yielding 100 70 80.