Question 36Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

What will be the output of the following code (assume size of int as 4 bytes in the

What will be the output of the following code (assume size of int as 4 bytes in the system)? #include<stdio.h> int main() { int arr[5] = {1, 2, 3, 4, 5}; printf("%lu", sizeof(arr)); return 0; }
  1. A20
  2. B5
  3. Ccompile time error
  4. D4
Show answerHide answer

Correct answer: (A) 20

Explanation

sizeof on an array gives its total size in bytes: 5 elements x 4 bytes = 20.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

This is question 36 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.