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

Consider the following code snippet. What will it print? int main() {

Consider the following code snippet. What will it print? #include <stdio.h> int main() { char str[][10] = {"one", "two", "three"}; printf("%c\n", str[2][4]); return 0; }
  1. Ar
  2. Be
  3. Cthree
  4. Dh
Show answerHide answer

Correct answer: (B) e

Explanation

str[2] is "three" and indexing from 0 gives t(0), h(1), r(2), e(3), e(4), so str[2][4] is 'e'.

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

This is question 28 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.