Question 15Asked in DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 3

What is the output of the following code written in C? void main()

What is the output of the following code written in C? void main() { printf("%d%d%d", 62, 062, 0x62); }
  1. A506298
  2. B629850
  3. C625098
  4. D986250
Show answerHide answer

Correct answer: (C) 625098

Explanation

62 is decimal, 062 is octal = 6×8 + 2 = 50, and 0x62 is hexadecimal = 6×16 + 2 = 98. With no separators, the output is 625098.

From DSSSB TGT Computer Science PYQ (Technical), 1 Aug 2021, Shift 3

This is question 15 of DSSSB TGT Computer Science PYQ (Technical), 1 Aug 2021, Shift 3. 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.