What will be the output of the given program? void main() { int arr[10] = { 1,…

PYQ TCS NQT 2025

What will be the output of the given program?

void main()

{

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

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

}

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

  1. A.

    error

  2. B.

    5

  3. C.

    1 2 3 4 5

  4. D.

    0

Attempted by 1188 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…