What will the contents of @b array ? my @a = (10, 5, 1); my @b = sort @a;

  1. (1, 5, 10)

  2. (1, 10, 5)

  3. (10, 5, 1)

  4. (5, 10, 1)


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) (1, 5, 10) - This option is incorrect because it is not the correct sorted order of the elements in the array @a.

Option B) (1, 10, 5) - This option is the correct answer. When we sort the elements in the array @a, the result is (1, 10, 5) because the elements are sorted in ascending order.

Option C) (10, 5, 1) - This option is incorrect because it is not the correct sorted order of the elements in the array @a.

Option D) (5, 10, 1) - This option is incorrect because it is not the correct sorted order of the elements in the array @a.

The correct answer is B. This option is correct because when we sort the elements in the array @a, the result is (1, 10, 5).

Find more quizzes: