Question 40Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

What does the first dimension and the second dimension represents in a two-dimensional

What does the first dimension and the second dimension represents in a two-dimensional character array?
  1. AThe first dimension stores the length of each name, and the second stores the number of names.
  2. BThe first dimension represents the number of names in the array, and the second dimension represents the maximum length of each name.
  3. CThe first dimension represents the maximum length of the names, and the second dimension represents the number of names.
  4. DThe first dimension holds the total number of characters, and the second dimension stores the number of names.
Show answerHide answer

Correct answer: (B) The first dimension represents the number of names in the array, and the second dimension represents the maximum length of each name.

Explanation

In char names[N][L], the first dimension is the number of strings (rows) and the second is the maximum length of each string, including the null character.

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

This is question 40 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). 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.