Which operator is used to access the first or second element of a pair?

a) ->
b) .
c) *
d) []

1 thought on “Which operator is used to access the first or second element of a pair?”

  1. b
    Explanation: .(dot) operator is used to access the first or second element of a pair. For example, if p = (1,2) is a pair then 2 can be accessed by using p.first and 2 can be accessed using p.second.

Leave a Comment