engineering computer science MCQ #2174

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

engineering computer science MCQ #2174

  1. Question 1

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

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

    Answer: Garbage value

    Explanation: Uninitialized elements in an array contain garbage values. NET computer science MCQs often test this core concept.