Question 133

What is the output? printf("%d", strcmp("abc", "abd") < 0);

What is the output? printf("%d", strcmp("abc", "abd") < 0);
  1. A0
  2. B−1
  3. C1
  4. DError
Show answerHide answer

Correct answer: (C) 1

Explanation

"abc" is smaller than "abd", so strcmp is negative and the comparison is true.

From DSSSB TGT Computer Science Full Mock Test 5

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