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-aConceptIn C++, language elements are classified by the role they perform. Access specifiers control member accessibility, operators perform operations,…

  1. A.

    i-d, ii-c, iii-a, iv-b

  2. B.

    i-c, ii-d, iii-b, iv-a

  3. C.

    i-a, ii-d, iii-b, iv-c

  4. 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

  1. private controls access to class members, so the pair is i-b.

  2. sizeof is a unary operator that yields the size in bytes of a type or expression, so the pair is ii-c.

  3. static is a storage-class specifier, so the pair is iii-d.

  4. long modifies 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.

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…