Predict the Output: void main() { int arr[10] = { 1, 2, 3, 4, 5 };…

PYQ TCS NQT 2026

Predict the Output:

void main()

{

int arr[10] = { 1, 2, 3, 4, 5 };

printf("%d", arr[5]);

}

Type '50' in the answer if there is compile time or run time error in the above code.

  1. A.

    0

  2. B.

    1

  3. C.

    error

  4. D.

    1 2 3 4 5

Attempted by 1180 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…