hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
    arrow
    arrow
    arrow
    Which of the following C statements can also be used in place of num[i]? (i) *(num + i ) (ii) i[num] (iii) *(i+num)
    Question

    Which of the following C statements can also be used in place of num[i]?
    (i) *(num + i )
    (ii) i[num]
    (iii) *(i+num)

    A.

    Only (ii)

    B.

    (i), (ii) and (iii)

    C.

    Only (i)

    D.

    Only (iii)

    Correct option is B

    In C language, the expression num[i] is defined as *(num + i).

    Due to commutativity of addition, num + i and i + num represent the same memory address. Therefore, *(i + num) is also equivalent to num[i].
    Additionally, the syntax i[num] is valid because array subscripting in C is defined as a symmetric operation — meaning a[b] is identical to b[a].

    Hence, all three — *(num + i), i[num], and *(i + num) — produce the same result as num[i].

    Important Key Points:

    1. In C, the array subscript operator [ ] is defined as *(base + index).
    2. The expression num[i] and i[num] are functionally identical.
    3. Both pointer arithmetic and array indexing ultimately reference the same memory address.

    Knowledge Booster:

    • Only (ii): Incorrect because (ii) is valid, but excluding (i) and (iii) is wrong — they are also equivalent.
    • Only (i): Incorrect since (ii) and (iii) yield the same outcome.
    • Only (iii): Incorrect because (i) and (ii) are equally valid representations of num[i].

    Free Tests

    Free
    Must Attempt

    UP SI 2025 Full Mock Test : 01

    languageIcon English
    • pdpQsnIcon160 Questions
    • pdpsheetsIcon400 Marks
    • timerIcon120 Mins
    languageIcon English
    Free
    Must Attempt

    UP Police Constable Full Mock Test 01

    languageIcon English
    • pdpQsnIcon150 Questions
    • pdpsheetsIcon300 Marks
    • timerIcon120 Mins
    languageIcon English
    Free
    Must Attempt

    Government Policies and Scheme

    languageIcon English
    • pdpQsnIcon10 Questions
    • pdpsheetsIcon20 Marks
    • timerIcon5 Mins
    languageIcon English
    test-prime-package

    Access ‘UPSSSC’ Mock Tests with

    • 60000+ Mocks and Previous Year Papers
    • Unlimited Re-Attempts
    • Personalised Report Card
    • 500% Refund on Final Selection
    • Largest Community
    students-icon
    354k+ students have already unlocked exclusive benefits with Test Prime!
    Our Plans
    Monthsup-arrow