engineering computer science MCQ #2138

What is the output of `int arr[5] = 1, 2, 3, 4, 5; printf('%d', *(arr + 2));`?

engineering computer science MCQ #2138

  1. Question 1

    Q1. What is the output of `int arr[5] = 1, 2, 3, 4, 5; printf('%d', *(arr + 2));`?

    • A) 1
    • B) 2
    • C) 3
    • D) Error

    Answer: 3

    Explanation: Array indexing is equivalent to pointer arithmetic; *(arr + 2) accesses the third element.