Multiple choice

Consider the Array @Countries = ("India", "Denmark", "Russia", "Germany", "Japan", "Ireland")

Which of the following statement is correct about the Array operations?

  1. push(@Countries, "Canada") will add new country "Canada" at the beginning of the array @Countries

    Now @Country gives @Countries = ("Canada", "India", "Denmark", "Russia", "Germany", "Japan", "Ireland")

  2. push(@Countries, "Canada") will add new country "Canada" at the end of the array @Countries

    Now @Countries gives @Countries = ("India", "Denmark", "Russia", "Germany", "Japan", "Ireland", "Canada")

  3. pop(@Countries, "India") will remove country "India" from the array @Countries

    Now @Countries looks like @Countries = ("Denmark", "Russia", "Germany", "Japan", "Ireland")

  4. pop(@Countries, "Ireland") will remove the country "Ireland" from the array @Countries

    Now @Countries looks like @Countries = ("India", "Denmark", "Russia", "Germany", "Japan")

  5. pop(@Countries) will remove the country "Ireland" last element of the array @Countries

    Now @Countries looks like @Countries = ("India", "Denmark", "Russia", "Germany", "Japan")

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

Yes, Push function on array will add element at the end of the array Yes, pop function removes one element at the end of the array. It has only one argument, i.e., Array Name..