Given below are some ways to declare and initialize pair. Choose the correct alternative way to do so:

  
pair  p1
pair  p2
pair  p3
pair  p4

(A) pair p1 and pair p2
(B) pair p3 and pair p4
(C) pair p1 and pair p4
(D) All of them


Answer: (D)

Explanation:
Pair is used to combine together two values which may be different in type. Pair provides a way to store two heterogeneous objects as a single unit.

Quiz of this Question


  • Last Updated : 20 Nov, 2018

Share your thoughts in the comments