Consider Column-I and Column-II in the context of C++ and select the correctly…
2022
Consider Column-I and Column-II in the context of C++ and select the correctly matched code.
Column-I (C++ term) | Column-II (category) |
|---|---|
i. private | a. Data type modifier |
ii. sizeof | b. Access specifier |
iii. static | c. Operator |
iv. long | d. Storage-class specifier |
Answer: D. i-b, ii-c, iii-d, iv-a — ConceptIn C++, language elements are classified by the role they perform. Access specifiers control member accessibility, operators perform operations,…
- A.
i-d, ii-c, iii-a, iv-b
- B.
i-c, ii-d, iii-b, iv-a
- C.
i-a, ii-d, iii-b, iv-c
- D.
i-b, ii-c, iii-d, iv-a
Attempted by 1011 students.
Show answer & explanation
Correct answer: D
Concept
In C++, language elements are classified by the role they perform. Access specifiers control member accessibility, operators perform operations, storage-class specifiers describe storage duration or linkage, and type modifiers alter a type.
For a matching question, classify each term independently and then combine the four term-to-category pairs into one code.
Application
privatecontrols access to class members, so the pair is i-b.sizeofis a unary operator that yields the size in bytes of a type or expression, so the pair is ii-c.staticis a storage-class specifier, so the pair is iii-d.longmodifies an integer or floating-point type, so the pair is iv-a.
Cross-check
C++ term | Category |
|---|---|
private | Access specifier |
sizeof | Operator |
static | Storage-class specifier |
long | Data type modifier |
Each category a-d is used exactly once, giving the complete code i-b, ii-c, iii-d, iv-a.
Result
The correctly matched code is i-b, ii-c, iii-d, iv-a.