Question 130

What is the output? char str[] = "ABC";

What is the output? char str[] = "ABC"; str[1] = 'X'; printf("%s", str);
  1. AABC
  2. BABX
  3. CAXC
  4. DXBC
Show answerHide answer

Correct answer: (C) AXC

Explanation

A char array can be modified; index 1 becomes X.

From DSSSB TGT Computer Science Full Mock Test 4

This is question 130 of DSSSB TGT Computer Science Full Mock Test 4. 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.