engineering computer science MCQ #2145

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

engineering computer science MCQ #2145

  1. Question 1

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

    • A) 2
    • B) 1
    • C) 0
    • D) Garbage value

    Answer: 0

    Explanation: Partially initialized arrays have remaining elements initialized to zero. NET computer science MCQs often test this core concept.