engineering computer science MCQ #2161

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

engineering computer science MCQ #2161

  1. Question 1

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

    • A) 3
    • B) Garbage value
    • C) Error
    • D) 0

    Answer: Garbage value

    Explanation: Accessing an array out of bounds results in undefined behavior, typically a garbage value.